Hi,
Please help!
I am trying to add a new row to igGrid table. I have a button "Add" when I click on it I want to add a new blank row where I can enter values.
When I am trying to do something like this:
jQuery("#securityOnlyModel").igGridUpdating("option", "enableAddRow", true);
jQuery("#securityonlyModel").igGridUpdating("startAddRowEdit");
It is adding a new row with "Add new row" button which I don't want. I want to add a row directly into edit mode.
Also I want to add multiple rows at the same time. So if I click on "Add" multiple times I want to add multiple rows and then I can enter values at the same time.
One more thing, right now all the rows are read only so that I can not change their values but in the case of new row I should be able to enter values in it.
Thanks,
Mohan
Hello Mohan,
After startAddRowEdit, the endEdit function can be called in order to save the new row to the igGrid as a record. Afterwards start edit mode for the newly added row, by calling the method startEdit.
What I would suggest for the readOnly rows - when the grid is rendered add, for example, a "readOnly" class to every row in the grid. On editRowStarting event check if the row for editing has this class and if it does cancel the event.
Only one row at a time can be in edit mode. Multiple rows cannot be edited at the same time.
I have attached a sample in reference to your issue. I have customized it to make a newly added row readOnly after all of its fields are filled. Please test it and let me know how it went.
Regards,Ivaylo HubenovEntry-level developer
Hi Ivaylo,
Thank you for your quick response. I can not make all rows read only. In my table their are some columns which are editable. I am attaching a code sample of mine for your reference.
And also the first column of my table is a "delete" button, I am not sure how I will add this button in the first column for new rows.