Is there a valid example somewhere that shows using the RowEditingTemplate when adding a new row? I found one an older one, but I am so lost on the errors.
The following code will launch the RowEditingTemplate but i have not found a way to push the added row into the main part of the grid without tabing to the end of the new row. In order words, call the RowAdding event on the server. Have any ideas?
function GetEditingCore() { var wdgConferenceRooms = $find('wdgConferenceRooms'); var behaviors; var editCore;
behaviors = wdgConferenceRooms.get_behaviors(); editCore = behaviors.get_editingCore();
return editCore;}function GetRowEditingTemplate() { var rowTemplate; var editCore;
editCore = GetEditingCore(); rowTemplate = editCore.get_behaviors().get_rowEditingTemplate();
return rowTemplate;}
function wdgConferenceRooms_RowAdding_EnteringEditMode(sender, eventArgs){ ///<summary> /// ///</summary> ///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param> ///<param name="eventArgs" type="Infragistics.Web.UI.CancelEditModeEventArgs"></param>
//Add code to handle your event here.
var rowTemplate = GetRowEditingTemplate(); var row = eventArgs.getCell().get_row();
rowTemplate.enterEditMode( row );}
Off of the row adding behavior, there is a method called _commitRow() that will take the values in the add row and commit it to the server. So you would need to have set the values in the add row first. Alternatively, you could call grid.get_rows().add(valArray) where valArray is an array of values you get from the RET for the new row.
regards,David Young
Initializing the row and then using the
wdgConferenceRooms.get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._commitRow();
worked but is there another method that is not preface with "_" which does the same thing. My understanding is that methods / variables that are prefixed with this are considered private or subject to change without warning.
It appears to get through all of this code, but it does not update the grid. Is there an event or something I am suppose to be calling?
Do you have the
wdgConferenceRooms_RowAdding event on the server?