knockout sample: handle items removal
This commit is contained in:
parent
fb9d5a1a97
commit
1adc38e5f7
1 changed files with 3 additions and 0 deletions
|
|
@ -47,6 +47,9 @@ ko.components.register('dashboard-grid', {
|
|||
}
|
||||
|
||||
grid.add_widget(item);
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(item[0], function () {
|
||||
grid.remove_widget(item);
|
||||
});
|
||||
}, this);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue