javascript - refreshing the data in a list and store, sencha touch -
i have itemtaphold event on list. in event make ajax request this:
ext.ajax.request({ url: //goes delete php script, method: 'post', params: { userid: userid, name: name }, success: function (response) { ext.msg.alert( name + " verwijderd"); }, failure: function (response) { } });
this bit of code works, tapped item deleted in database.
the problem how refresh list/store? tried refresh list refresh()
working cause checkboxes have in list go unchecked.
i did console.log(selections);
(which store list using) , return me store data before deleted record.
am missing here?
ps. don't know put refresh methods in event? after, before or in ajax request?
there are couple of store methods can use:
- remove( records )
- removeat( index )
in success function call store.remove(<your record>);
alternatively, index of record userid remove it.
var index = store.find('userid', userid); store.removeat(index);
the event fired removing record store caught grid , should updated accordingly.
Comments
Post a Comment