Hello all,
I have recently been expriencing a problem regarding my WebDataGrid returning as undefined when using the client-side igtbl_getGridById method, as shown below:
var grid = igtbl_getGridById("<%= myWebDataGrid.ClientID %>");
The WebDataGrid itself is located inside the content page that uses a master page, then a WebDialogWindow, which contains the content pane and template tags.
I have checked that the WebDataGrid identifier is correct and tried various fixes/work-arounds as suggested by other forum members. I have tried the following:
var grid = igtbl_getGridById("<%= myWebDataGrid.UniqueID %>");
var grid = $find("<%= myWebDataGrid.ClientID %>");
var grid = $find("<%= myWebDataGrid.UniqueID %>");
The above two are the only ones that have successfully returned a WebDataGrid object, but when doing so they do not expose the required infragistics methods, I think this is because the $find method is a standard JavaScript function.
I have also tried replacing the _ character with x as a suggested work-around with no luck.
Any help is much appreciated.
Ben.
Hi Ben,
igtbl_getGridById is for the older UltraWebGrid. To find a WebDataGrid, you should use $find. This is from MS ajax, which this control is built on. Another option you could try would be to handle the initialize event of the data grid and save off the grid parameter there. But your second option to find the grid should be the one to use.
regards,David Young
Thanks for the clarification, hopefully I'll be able to remember this for future.
How can one access the Active Row and Cells within that row (or any row in particular)? in the old UltraWebGrid you could:
grid.getActiveRow().getCellFromKey('ColumnXYZ');
to get the ColumnXYZ cell in active row'.
If you are supposed to use the $find method, how can you access those objects?
Actually I was finally able to figure this out.
var activeRow = grid.get_behaviors().get_activation().get_activeCell().get_row(); var cell = activeRow.get_cellByColumnKey( "ID");
var cell = activeRow.get_cellByColumnKey(
then you can use
cell.get_value();
or
cell.set_value()
although the .get_value() returned the column's droplist HTML instead of its "value".