リストでモデルを使用していません。ユーザーが開示リスナーを使用してリスト内の 1 つの項目を削除すると、削除されていることが示されますが、後で Ext.getCmp(listIndex).getData() を使用すると、まだ削除されていないことが示されます。以下は list のビューのコードです:
{
xtype: 'list',
height: '100%',
id: 'listId',
style: 'padding:5px;border:1px solid green;',
itemTpl: '{Name}',
disableSelection: true,
onItemDisclosure: true,
listeners: {
disclose: function (list, record, target, index, e, eOpts) {
console.log(list.getData());
var deleteFunc = function (buttonId, value, opt) {
if ('yes' == buttonId) {
list.getStore().remove(record);
list.getStore().sync(); // seems not working
console.log(list.getData());
}
};
Ext.Msg.confirm('confirm', 'are you sure to delete this one ?', deleteFunc);
},
}
}