SenchaArchitectで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();
実行すると、ログにオブジェクトの配列が表示されます。また、remove関数の実行後にエラーが発生することもありません。ただし、ストアは更新されません。つまり、選択したアイテムは削除されません。
誰か助けてくれませんか。
ありがとう