I thought describing how I solved an issue today might help someone else.
I’m working with JqGrid and needed to add a new row full of empty strings. I’ll actually make this more complex later based on the column attributes, but the simple version makes the point.
The documentation for adding a new row is:
Problem is that I’m creating empty data based on the columns – I don’t know what the columns are ahead of time.
This code returns an object which has properties for each column in the grid. Each column contains an empty string, except the key column.