我必須刪除編輯器網格中的選定項目。首先加載商店,用戶可以選擇添加或刪除空白行到這個網格,然後他們可以編輯。問題不在於刪除從商店加載的初始記錄。當我添加一個額外的行,編輯它然後選擇刪除它(用戶可能認爲他不需要這一行)時,問題就出現了。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