I would have thought this to be simple. I need to, on leave of the cell, trap an event, and make an ajax call ( an item lookup) and upon return load other cells in the row with the results of that lookup.
I have found I can only hook into the blur and valueChanged events which. Those don't seem to be grid events. Also, in valueChanged I need to save off the row index so that my ajax response set the other cells for the current row...however it seems activeRow and activeCell are not set in the grid object.
I have messed with the updating mode and selection mode but neither of these seem to help.
Can someone share a solution?
Update: I am able to get the activeRow (athough I wonder why it's index is 2 when I am adding the first row)
However, I get this message "Uncaught Error: cannot call methods on igGridUpdating prior to initialization; attempted to call method 'setCellValue'"
When I try in the ajax sucess handler: grid.igGridUpdating('setCellValue',idx,'description',data.results[0].description);
Hi timjnelson,
Thank you for posting in our forums. I have a questions regarding your scenario: what is the editing mode that you are using: row or cell mode? In row mode you can use the editor’s blur event as you discovered already. From there you can get the data-id attribute of the row ( the TR element) which holds the primary key value of the row. And after that you can use this value for setCellValue and update the other editors with the desired data. I’m attaching a sample page that demonstrates my suggestion. Please check it and let me know if it works for you.
I’m looking forward to your reply.
Kind regards,
Petko Zhekov
Software Engineer
Hi Petko,
Can you share this same example in below Razor expression format(for blur event).
eg.
feature.Updating() .EditMode(GridEditMode.Row) .ShowDoneCancelButtons(true) .EnableAddRow(false) .EnableDeleteRow(false) .ColumnSettings(cs => { cs.ColumnSetting().ColumnKey("ServiceDescription").ReadOnly(true); cs.ColumnSetting().ColumnKey("RevCode").ReadOnly(true); cs.ColumnSetting().ColumnKey("TotalCharge").ReadOnly(true); cs.ColumnSetting().ColumnKey("Classification").ReadOnly(true); });