Javascript/Sencha

Sencha grid 선택된 데이터 삭제 처리

바리새인 2024. 12. 18. 22:19
const grid = btn.up('grid');
const store = grid.getStore();
const selection = grid.getSelectionModel().getSelection();

if (selection.length > 0) {
Ext.Array.each(selection, function (record) {
	if (record.phantom) {
		// Directly remove newly inserted rows
		store.remove(record);
	} else {
		// Flag existing rows as deleted
		record.set('flagDeleted', true);
	}
});