<script type= "Text/javascript" > var key = 0; var data = [ [1, 33.33, "String_0", "2012-01-01", true], [3, 33.33, "string_1", "2012-01-01", false], [5, 33.33, "string_2", "2012-01-01", true], [7, 33.33, "String_3", "2012-01-01", false] ]; Ext.onready (function () { Store1.proxy = new Ext.data.MemoryProxy (data), Store1.loaddata (data, true); }); var Ds_model = Ext.data.Record.create ([ ' Intcolumn ', ' Doublecolumn ', ' Stringcolumn ', ' Datetimecolumn ', ' Boolcolumn ' //]); var Ds_model = Ext.data.Record.create ([ {name: ' Intcolumn ', type: ' Int '}, {name: ' Doublecolumn ', type: ' Float '}, {name: ' Stringcolumn ', type: ' String '}, {name: ' Datetimecolumn ', type: ' Date '}, {name: ' Boolcolumn ', type: ' Boolean '} ]); var youradd = function (store) { key++; key++; var newdata = new Ds_model ( { Intcolumn:key, Doublecolumn: (Key * 100)/3, Stringcolumn: "String_" + 99, Datetimecolumn: ' 1999-01-01 ', Boolcolumn:false }) Newdata.commit (); Store.add (NewData); }; var youraddsorted = function (store) { key++; key++; var newdata = new Ds_model ( { Intcolumn:key, Doublecolumn: (Key * 100)/3, Stringcolumn: "String_" + 99, Datetimecolumn: ' 1999-01-01 ', Boolcolumn:false }) Newdata.commit (); Store.addsorted (NewData); }; var Yourinsert = function (store) { key++; key++; var newdata = new Ds_model ( { intcolumn:key++, Doublecolumn: (Key * 100)/3, Stringcolumn: "String_" + key, Datetimecolumn: ' 1999-01-01 ', Boolcolumn:false }) Newdata.commit (); Store.insert (0, NewData); }; var yourremove = function (store, grid) { var record = Grid.getselectionmodel (). getselected (); if (record!= undefined) { Store.remove (record); Grid.getselectionmodel (). Clearselections (); } else { Alert (' not selected. '); } }; var yourremoveat = function (store, removeatvalue) { Store.removeat (Removeatvalue); }; var yourremoveall = function (store) { Store.removeall (); }; var yourloaddata = function (store) { Store.loaddata (data); }; </script> |