I have different arrays bound to the combo on each data row. This is in continuation with sample provided in
http://es.infragistics.com/community/forums/t/92694.aspx
I have an igGrid (2013.2 version) with virtualization set to true and mode as continuous. The grid has Updating feature with cell mode editing enabled.
Hello Anitha,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.
Best Regards, Hristo AnastasovDeveloper Support EngineerInfragistics, Inc.
Hello William,
Your code seems fine. However after changing the selected item in the combo you need to lose focus on the cell so that the new value will be committed. If you just change the value and immediately call
var cellValue = $grid.igGrid("getCellValue", firstRowId, "MIN_AGE");
you will receive the old value for sure.
I hope this helps.
I don't mean to jump on your thread but I have very close to the same issue. I'm using
$("#age_range").igGrid({ dataSource: data.age_range, autoGenerateColumns: false, primaryKey: "PK", autoCommit: true, width: "100%", height: "90px", columns: [ { headerText: "PK", key: "PK", dataType: "string", hidden: true }, { headerText: "COLLECTION", key: "DBID", dataType: "string", width: "15%", editorOptions: { readOnly: true } }, { headerText: "SITE CODE", key: "SITE_CODE", dataType: "string", width: "15%", editorOptions: { readOnly: true } }, { headerText: "MIN AGE", key: "MIN_AGE", dataType: "string", width: "30%"}, { headerText: "MAX AGE", key: "MAX_AGE", dataType: "string", width: "40%"} ], features: [ { name: 'Updating', enableAddRow: false, enableDeleteRow: false, showDoneCancelButtons: false, editCellStarting: function (evt, ui) { // Test for condition on which to cancel cell editing // Here I use columnIndex property. This will disable from editing the first column in the grid. if (ui.columnIndex === 0 || ui.columnIndex === 1) // cancel the editing return false; }, columnSettings: [{ //The combo is defined as an editor provider. Combo options are defined under 'editorOptions'. columnKey: "MIN_AGE", editorType: 'combo', required: true, editorOptions: { mode: "dropdown", dataSource: ageArray } }, { //The combo is defined as an editor provider. Combo options are defined under 'editorOptions'. columnKey: "MAX_AGE", editorType: 'combo', required: true, editorOptions: { mode: "dropdown", dataSource: ageArray //textKey: "Name", //valueKey: "ID" } } ] } ]And then I'm using you code to find the value of the
$grid = $("#age_range"); var firstRowId = $grid.igGrid("rows")[0].getAttribute("data-id"); var cellValue = $grid.igGrid("getCellValue", firstRowId, "MIN_AGE");
But the only thing I get is what the dropdown was originally set to. I've looked at your example and see what you are doing but can't figure out what I'm missing to get the new value of the dropdown. Is there some feature or value that I need to add?
Thanks
Hello,
Please find answers to your questions below:
1) I have modified the sample in order to demonstrate how you can loop through every cell in the grid on button click. Every cell's value is then pushed into an array and the elements of the array are then printed in the text area (just to see it works).
for (i = 0; i < gridRows.length; i++) { var rowID = $("#grdCriteria").igGrid("rows")[i].getAttribute("data-id");
for (t = 0; t < gridCols.length; t++) { var colKey = gridCols[t].key; var cellValue = $("#grdCriteria").igGrid("getCellValue", rowID, colKey); cellsValues.push(cellValue); // adding every value to the array }}
$("#txtarea1").val(cellsValues); // writing the elements of the array to the text box
I have also removed every unnecessary code from the sample so now it is much more readable.
- http://help.infragistics.com/jQuery/2014.2/ui.igcombo
3) You should use the setCellValue of igGridUpdating