insertRows : function(){
/*
this = EditorGridPanel
this.store.recordType() = Recrod类型
*/
var recrod = new this.store.recordType();
/*
因为有的时候我们不是通过Ext.data.Record.create方法来构靠造这个Record的,
而是通过Ext.Data.Reader 或者 Store 的 fields 来构造Record的,
所以要用到下面的赋值代码
*/
recrod.data = {};
//获得Record的字段
var keys = this.store.fields.keys;
for(var i=0;i<keys.length;i++){
recrod.data[keys[i]] = '';
}
//停止EditorGridPanel编辑
this.stopEditing();
//将Record数据添入Store中
this.store.insert(0,recrod);
//开EditorGridPanel编辑,光标在第1行第2列
this.startEditing(0, 1);}
Ext EditorGridPanel 添加一行.通用解决办法
最新推荐文章于 2021-08-06 10:33:44 发布