ExtGrid 客户端 查看、添加、删除数据

阅读更多
请关注新浪微博 账号:屌丝开发控(http://weibo.com/u/3356934744)

获取选中的记录
var records = grid.getSelectionModel().getSelections();
var record = grid.getSelectionModel().getSelected();

客户端删除数据
var store = this.getStore();
for(var i= 0; i < records.length; i++){
         var record = records[i];
         store.remove(record);
}
store.commitChanges();



        //添加
        _doAdd : function(){
                var record = new Ext.grid.PropertyRecord({
                        ROrderDetailCode: '',
                        InnerProductDetail: '',
                        Count: '',
                        OriginalValue: '',
                        Remark: ''
            });
                this.stopEditing();  
            this.store.insert(0, record);
            this.startEditing(0,0);
        },

你可能感兴趣的:(Ext,Grid,Store)