Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resetting SlickGrid for new data

Tags:

slickgrid

I have a SlickGrid in which the user can choose various datasets. Thus the schema can change. So when the user selects a new dataset, I need to either delete the SlickGrid and start over, or clear the existing one.

What is the proper approach? Should I just delete the DOM node? I have looked through the API and cannot find any grid level calls that appears to accomplish what I am looking to do.

thanks

like image 939
user1883165 Avatar asked Oct 21 '25 02:10

user1883165


1 Answers

Use Data view and "OnChange()" call following lines,

grid.invalidateAllRows();
dataView.setItems(newData, "Id");
grid.render();

If your not using dataview try this,

        var data = []; \\or new array
        grid.setData(data);
        grid.render();
like image 96
Jatin patil Avatar answered Oct 27 '25 06:10

Jatin patil