Ext.onReady(function(){ var cm = new Ext.grid.ColumnModel([{ header:"id", dataIndex:"id" },{ header:"姓名", dataIndex:"name" //editor:new Ext.form.TextField() },{ header:"业务室", dataIndex:"department" //editor:new Ext.form.TextField() },{ header:"上午", dataIndex:"morning", editor:new Ext.form.TextField() },{ header:"下午", dataIndex:"afternoon", editor: new Ext.form.ComboBox({ fieldLabel : '性别', hiddenName : 'gender', store : new Ext.data.SimpleStore({ fields : ['abbr', 'state'], data : [['换休', '换休'], ['事假', '事假'], ['出差', '出差'], ['探亲假','探亲假']] }), valueField : 'abbr', displayField : 'state', typeAhead : true, mode : 'local', triggerAction : 'all', emptyText : '请选择性别', forceSelection : true, selectOnFocus : true, editable : false }) },{ header:"备注", dataIndex:"note", editor:new Ext.form.TextField() },{ header:"日期", dataIndex:"datenote", renderer:Ext.util.Format.dateRenderer('Y年m月d日'), editor:new Ext.form.DateField({format:'Y年m月d日'}) }]); var fields = ["id","name","department","morning","afternoon","note","datenote",{name:"datenote",type:"date",dateFormat:"Y-n-j"}]; var data = [ ["1","张三","计算机","正常","正常","无","2008-08-08"], ["2","张三"","计算机","正常","正常","无","2008-08-08"], ["3","张三","计算机","正常","正常","无","2008-08-08"], ["4","张三","计算机","正常","正常","无","2008-08-08"], ["5","张三","计算机","正常","正常","无","2008-08-08"]]; var store = new Ext.data.SimpleStore({ fields:fields, data:data }); var grid = new Ext.grid.EditorGridPanel({ title:"考勤", width:720, height:200, cm:cm, store:store, tbar : [{ text : '保存', tooltip : '保存考勤信息', iconCls : 'add', handler:this.onSaveButtonClick, scope:this }] }); grid.render(Ext.getBody()); });
初学EXtjs,我想把EditorGridPanel中信息一次存到数据库中怎么做呢?怎么能一次获得表中所有数据?不知道我说清楚没?