views:

210

answers:

2

I am trying to add a row to a slick grid on my page using javascript. The way I am able to do it now is by using the following code. I was just wondering if there was a better way to do the same.

....

//data is the array which was used to populate the SlickGrid
data.push({name:'Finish scanning the slickgrid js', complete:false}); 
grid.setData(data);
grid.render();

....
+1  A: 

This is the preferred way.

data.push({...});
grid.updateRowCount();
grid.render();

Calling .setData() forced the grid to re-render everything. By calling updateRowCount() you are notifying the grid the number of the rows have changed and that it needs to render what has been added or removed only.

Tin
A: 

how you do that process of inserting a row to do some grid function or invoke these parameters you describe.

gerar