在 Sencha Architect 上使用 ExtJs4.1。
我的 onDeleteButton 代码中有以下代码
onDeleteButtonClick: function(button, e, options) {
var active = this.activeRecord;
var myGrid = Ext.getCmp('publisherResultsGridView'),
sm = myGrid.getSelectionModel(),
selection = sm.getSelection(); // gives you a array of records(models)
if (selection.length > 0){
for( var i = 0; i < selection.length; i++) {
this.application.log('OnDeleteItemID is ' + selection);
}
this.remove(selection);
}
Remove
功能代码
remove: function(record) {
var store = Ext.getStore('PublisherProperties');
store.proxy.url = MasterDataManager.globals.url + "Publishers/";
store.remove(record);
store.sync();
当我运行它时,我可以在我的日志中看到一个对象数组,并且在执行删除函数后我也没有收到任何错误。但是商店没有更新,我的意思是它不会删除选定的项目。
有人能帮帮我吗。
谢谢