<ext:ResourceManager runat="server" />
<script type="text/javascript">
Ext.onReady(function () {
Ext.regModel('Student', {
fields: ['id', 'name', 'age'],
proxy: {
type: 'localstorage',//localstore 会保存在本地资源 sessionstoreage 刷新数据会被清空
id: 'User-Searches'
}
});
var store = new Ext.data.Store({
model: 'Student'
});
store.add({ name: '张三', age: 18 });
store.add({ name: '李四', age: 19 });
store.sync();
store.load();
var msg = [];
store.each(function (rec) {
msg.push(rec.get('id') + ' ' + rec.get('name') + ' ' + rec.get('age'));
});
</script>
<script type="text/javascript">
Ext.onReady(function () {
Ext.regModel('Student', {
fields: ['id', 'name', 'age'],
proxy: {
type: 'localstorage',//localstore 会保存在本地资源 sessionstoreage 刷新数据会被清空
id: 'User-Searches'
}
});
var store = new Ext.data.Store({
model: 'Student'
});
store.add({ name: '张三', age: 18 });
store.add({ name: '李四', age: 19 });
store.sync();
store.load();
var msg = [];
store.each(function (rec) {
msg.push(rec.get('id') + ' ' + rec.get('name') + ' ' + rec.get('age'));
});
alert(msg.join('\n'));
VS2010 如何写extjs
});</script>