PDA

View Full Version : [CLOSED] row on directMethod in grid editor dont work



farallones
Aug 14, 2013, 7:17 PM
in a grid editor with a directMethod in version 1.x working for obtain a row of the gridPanel but in version 2.x dont working.



<script type="text/javascript"> var edit = function (editor, e) {
/*
"e" is an edit event with the following properties:


grid - The grid
record - The record that was edited
field - The field name that was edited
value - The value being set
originalValue - The original value for the field, before the edit.
row - The grid table row
column - The grid Column defining the column that was edited.
rowIdx - The row index that was edited
colIdx - The column index that was edited
*/


// Call DirectMethod
if (e.value !== e.originalValue) {
ValorX.AfterEdit(e.record.data.OID, e.value, e.record, e.row);
}
};


[DirectMethod(Namespace = "ValorX")]
public void AfterEdit(int oid, string newValue, int row)
{
prodCotizar = (DataTable)Session["tablaprodCotizar"];
prodCotizar.Rows[row].BeginEdit();
prodCotizar.Rows[row][4] = Convert.ToDouble(newValue);
prodCotizar.Rows[row].EndEdit();
}

Vladimir
Aug 14, 2013, 7:37 PM
Can you describe the issue in details? What exactly don't work you?

Also I see that your direct method accepts three arguments but you pass four arguments
e.record and e.row cannot be passed as arguments because it cannot be serialized, I guess that you need to use e.rowIdx instead e.row