hello, i have problem related to list grid that when i m searching for a item and showing the data in list grid then it is showing data in list grid very well but issue is that when i searched again then the contents of search are added into previous result. Means previous contents remains as such and new search result appended in it. Plz help me to resolve this issue.
You’ll need to show your code.
My guess is that you are returning a changed primary key for your dataset or that you don’t have one defined.
Just a guess.
I have a similar problem. When I click the button to delete a record, the FindForm attached to the ListGrid causes a fetch which adds to the ListGrid contents. So I end up with twice the records.
Mike
Hy,
You could use:
grid.setData();
or
grid.data.invalidateCache()
Search for this in the docs.
invalidateCache() seemed to have no effect.
setData() worked, but then my ListGrid was totally empty after the remove.
I may not be putting these in the correct place. I put them here:
isc.IButton.create({
ID:"removeItemButton",
title:"Delete Item",
click : function () {
isc.confirm("Remove selected item?", null,
{targetGrid:itemList,
buttons:[
isc.Dialog.OK,
isc.Dialog.CANCEL
],
okClick : function () {
this.hide();
this.targetGrid.removeSelectedData();
this.targetGrid.setData([]);
},
}
);
}
Mike
Mike,
Most likely, your DataSource is configured to go the same dataURL or otherwise run the same code on “remove” as on “fetch”. So, SmartClient receives a set of new records that appear to be a consequence of doing the remove, and adds them to the dataset.
The correct response from the server for a “remove” operation is just the primary keys of the removed record.
Hopefully I may have found the solution from another thread…I’ll post again if it still doesn’t work.
On the extra fetch - there is a known bug regarding re-fetch after delete in SmartClient 6.0, with a patch available Addendums forum. Or your could just upgrade to 6.5.