I have the following scenario :
Grid has wdd editor provider, on the SelectionChanging it validates some values and offer user to finalize or cancel changes. If finalized chosen then through pagemethod.myFunction runs stored procedure on the back end to make some adjustments. Here little problem to address, when it comes back the value in the editor provider is changed but in the grid and underlying DS it will change only after user will leave current row.
What is the best way to trigger another postback from the function that is called by pagemethods.myFunction upon success so on the client row get changed, postback initiated and RowUpdating fired on the server.
Thanks
Sorry, never mind seems just set another cell active works and rowupdating get fired. :
var grid = $find("wdglr4Uno"); var ri = grid.get_behaviors().get_activation().get_activeCell().get_row().get_index() var nexRowCell = grid.get_rows().get_row(ri + 1).get_cellByColumnKey("FRCODE"); grid.get_behaviors().get_activation().set_activeCell(nexRowCell)
Still little issue : if grid has only one row... how to trigger rowupdating event that usually get fired when user chose another row. What would trigger rowUpdating in this case .
Hi Hristo, I guess I'm missing something. I'm attaching runnable sample pj. My goal is to trigger the postback along with rowUpdating event on the server. There is the JS function :
function GoodOutcome(ret) { alert("All values successfully changed from " + "\"" + ret[0] + " to " + ret[1]); var grid = $find("wdglr4Uno"); //var ri = grid.get_behaviors().get_activation().get_activeCell().get_row().get_index() // var nexRowCell = grid.get_rows().get_row(ri + 1).get_cellByColumnKey("FRCODE"); //grid.get_behaviors().get_activation().set_activeCell(nexRowCell) var editingCore = grid.get_behaviors().get_editingCore(); editingCore.commit();}
It takes control after page method PageMethods.ChangeMrcForFran(.. get executed, and need to trigger postback with the rowUpdating event on the server. When I execute commented out currently code that activates cell in another row then postback/rowUpdating sequence happening. When I have one row grid, there is no another row to activate and when I commented out activation part and added editingCore.commit(); somehow neither postback nor rowUpdating happening. Any ideas why ?
Hello,
In order to implement fire the RowUpdating event when need to handle ExitingEditMode event and commit changes as shown below:
Part of Markup from the sample wdg_wEditors.rar:<Behaviors><ig:EditingCore AutoCRUD="False"><EditingClientEvents RowAdding="wdglr4Uno_Editing_RowAdding" /><Behaviors><ig:CellEditing><ColumnSettings><ig:EditingColumnSetting ColumnKey="MGT" EditorID="ddpUnoMrc" /><ig:EditingColumnSetting ColumnKey="FRCODE" EditorID="ddpUnoFran" /></ColumnSettings><CellEditingClientEvents ExitingEditMode="wdglr4Uno_CellEditing_ExitingEditMode" /><EditModeActions MouseClick="Single" /></ig:CellEditing><ig:RowAdding><ColumnSettings><ig:RowAddingColumnSetting ColumnKey="MGT" DefaultValueAsString=" " EditorID="ddpUnoMrc" /><ig:RowAddingColumnSetting ColumnKey="FRCODE" DefaultValueAsString=" " EditorID="ddpUnoFran" /></ColumnSettings><EditModeActions MouseClick="Single" /></ig:RowAdding></Behaviors></ig:EditingCore><ig:Activation></ig:Activation><ig:RowSelectors></ig:RowSelectors></Behaviors>
Relevant Script:
function wdglr4Uno_CellEditing_ExitingEditMode(sender, eventArgs){var grid = $find("wdglr4Uno");var editingCore = grid.get_behaviors().get_editingCore();editingCore.commit();}
I hope this helps.
Hello ,
I am just following up to see if you need any assistance with this matter.
I'll be working on this issue in couple of days and let you know outcome. Thanks.
Thanks, it did work for me.