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 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); });
Hello timjnelson,
Please do not hesitate to contact me if you have any further questions regarding this scenario.
Thank you for your reply.
When a DIV is used as the grid's target element, the main grid table is instantiated in that div. That inner table is used by the grid's widget (and the feature widgets) use that inner table as opposed to the div element. Therefore it is useful to use the id() and widget() methods prior to manipulating an igGrid with a div target.
When a table is used as the target of the igGrid, these issues do not apply as the table itself is used as the main grid table.
Hope this helps. Please do not hesitate to contact me if you have any questions.
It appears the issue stems from putting the grid in a DIV tag vs. a TABLE tag. I don't get the error when I use a TABLE. Why the difference?
hey,
there are several cell and row editing events that you can use, check this out:
http://www.igniteui.com/help/api/2013.2/ui.iggridupdating => events
Thanks,
Angel