Hi there,
I'm using setCellValue of igGridUpdating to update a specific column cell value (assume on the same row) after combo value selection from another column, it throws "cannot call methods on igGridUpdating prior to initialization; attempted to call method 'setCellValue'" exception.
Any solution?
Thanks,
Michael
Hello Michael,
This error is caused by a known issue. You should change the grid placeholder to a TABLE element in order to use the grid updating feature API. However that's not the only problem. Calling setCellValue on a row which is currently in edit mode rises another error (which I guess is not supported scenario). To overcome the second problem, my suggestion is to change the editMode to 'row' and manipulate the other cell editor like demonstrated in the following sample: Editing Combo Editor.
Hope this helps,
Martin Pavlov
Infragistics, Inc.
Hi Martin,
Thanks for suggestion. Changing placeholder to TABLE doesn't solve the problem.
Our business application requires "cell" editMode instead of "row". So do you mean there is no workaround or fixes that allows to update another cell value after picking a value from combo dropdown?
Hi Michael,
Changing the grid placeholder to TABLE element will allow you to call igGridUpdating API methods like this:
$("#gridProducts").igGridUpdating("setCellValue", 2, "Description", "Sample");
But that will not solve your problem, because setCellValue is not meant to be used while the igGridUpdating is in edit mode.
As workaround I would suggest that you manually change the column cell value by manipulating the grid DOM and then use the igDataSource API to reflect that change in the grid data source. Use $(".selector").data("igGrid").dataSource; to get a reference to the grid data source and call $.ig.DataSource.setCellValue API to update the data source.
Hope this helps,Martin PavlovInfragistics, Inc.
I am still following your case. Have you been able to resolve your issue according to my suggestions?
Please feel free to contact me if you have any further questions regarding this matter.
Yes, Martin's suggestion works. Just like to confirm, after $.ig.DataSource.setCellValue API call, it need to call $.ig.DataSource.dataBind() to refresh whole grid or there is a way just refresh updated row?
Hi,
Can we have a working example of updating a cell value on click of a button embedded in a grid in jQuery.
I am unable to do the things right.
Scenerio:
I need to have buttons in a grid row and then click on the button I need to change the cell value.
After changing multiple rows I need to update the changes to DB
Vinod
You can update the layout by calling explicitly $.ig.DataSource.dataBind() . Still if you don’t want to refresh the whole igGrid you can manually change the value on the client by going through the grid DOM and modifying directly the content of the <td></td> for the particular cell.
Please let me know if you need additional details on this.