Hello,
I’d like to dynamically add row, which consists of 3 cells: string, string, dropdownlist
I followed this tutorial: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/createremoveupdatedata.htm?arctic
Which is working fine for adding rows with string cells.
However how should I modify the function generaterow
var generaterow = function (i) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
row["dropdown"] = <strong>//what should come here?</strong>
return row;
}
so that the row[“dropdown”] would be a cell of dropdownlist consisting of for example [listitem1,listitem2].
Thank you very much.