Is it possible to Add new row to igGrid(igHierarchicalGrid) programmatically, and how to do it?
Hello Branko,
Thank you for getting back to me.
As I understand you haven't enabled adding a new row by default.
features: [
{ name: 'Updating', enableAddRow: false,
.....
For the purpose you can enable it at button click and enter edit mode of the add row using startAddRowEdit method
http://help.infragistics.com/jQuery/2013.2/ui.iggridupdating#methods
<input id="startEdit" type="button" value="startEdit" />
....
$('#startEdit').bind({
click: function (e) {
$( "#grid1" ).igGridUpdating( "option", "enableAddRow", true );
$( "#grid1" ).igGridUpdating( "startAddRowEdit", e );
}
});
and disable it in editRowEnded event handler
http://help.infragistics.com/jQuery/2013.2/ui.iggridupdating#events
{ name: 'Updating', enableAddRow: false, editRowEnded: function ( evt, ui ) { $( "#grid1" ).igGridUpdating( "option", "enableAddRow", false ); }, .....
Hi Tsvetelina,
thank you for having interest in this case. In our web app we have "Add" state in which is entering with button click. It was clients demand, that when they click on that button, editable row appears. So, can we do that with igGrid?
Thank you for your clarification.
editCellStarting won't be fired in your scenario.
By design, events only trigger on user interaction.
Events do not trigger when the public API is used.
Please refer to the known issues docs about that.
http://help.infragistics.com/Doc/jQuery/2013.2/CLR4.0?page=igGrid_Known_Issues.html
Can you please clarify what you are trying to achieve and why you need handling editCellStarting event?
I also found a thread discussing similar issue but I am not sure if this is your case
http://es.infragistics.com/community/forums/p/78218/396521.aspx
Hope hearing from you.
No, I want to start adding new row, like click on the "Add New row" row under header, how to do that programmatically?
igGridUpdating's addRow method should be used for adding rows programmatically. Please refer to the API documentation for more information: http://help.infragistics.com/jQuery/2013.2/ui.iggridupdating#methods
Please, let me know if you have any other questions and/or concerns!
Best regards,
Stamen Stoychev