Slickgrid add new row on demand

user1347790 picture user1347790 · Apr 21, 2012 · Viewed 8.6k times · Source

Is there a way to add a new row to a slickgrid on demand? For example, have a button on the page that shows the new row when clicked.

Answer

coolsun21 picture coolsun21 · Jul 12, 2012

It can be done easily using dataView.addItem(params), just replace params with your parameters..

function addNewRow(){
   var item = { "id": "new_" + (Math.round(Math.random() * 10000)), "Controller": tempcont, "SrNo1": tempsrno };             
   dataView.addItem(item);
}

here id, Controller, SrNo1 are ids of colunm