我必须删除编辑器网格中的选定项目。首先加载商店,用户可以选择添加或删除空白行到这个网格,然后他们可以编辑。问题不在于删除从商店加载的初始记录。当我添加一个额外的行,编辑它然后选择删除它(用户可能认为他不需要这一行)时,问题就出现了。Extjs - 从商店中删除新添加的选定项目
看来,当我想使用store.getModifiedRecords保存更改时,它仍然会看到已删除的行,并对其进行处理。这里是删除按钮:
442
443 text:'Remove',
444 tooltip:'Remove attribute',
445 iconCls:'silk-table_delete',
446 handler: function() {
447 var selectedItem = attributeEditor.getSelectionModel().getSelected();
448
449 // Check if we have selected item
450 if (selectedItem) {
451 // Get selected item value
452 var attribute = selectedItem.get('Name');
453
454 // Remove selected
455 attributeStore.remove(selectedItem);
456
457 // Add to our removed attributes hash
458 if (id) {
459 RemovedAttributes.push(attribute);
460 }
461 } else {
462 wispUserFormWindow.getEl().mask();
463
464 // Display error
465 Ext.Msg.show({
466 title: "Nothing selected",
467 msg: "No attribute selected",
468 icon: Ext.MessageBox.ERROR,
469 buttons: Ext.Msg.CANCEL,
470 modal: false,
471 fn: function() {
472 wispUserFormWindow.getEl().unmask();
473 }
474 });
475 }
476 }
477 }
只是一个更新..仍然不知道这是为什么发生,但我所做的w ^与之前一样,请检查删除列表中是否有任何项目匹配,并将它们从请求列表中删除。 – imnotneo 2009-08-03 07:27:50