i am combo in IgGrid Cell so I want to change another cell text on select the combo value Using JS
Loading
i am combo in IgGrid Cell so I want to change another cell text on select the combo value Using JS
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayraj ChhayaRank #304 · 8.2K reputationPosted Dec 18, 2023, 2:06 AM EST
To change the text of another cell in an IgGrid when selecting a value from a combo box cell, you can use JavaScript to handle the event when the combo box value changes. Here's an example of how you can achieve this:
// Assuming you have an IgGrid with a combo box column and a text column var grid = $("#grid").igGrid({ columns: [ { headerText: "Combo Box", key: "combo", dataType: "string", editorType: "combo" }, { headerText: "Text", key: "text", dataType: "string" } ], dataSource: data // Replace 'data' with your actual data source }); // Event handler for combo box value change grid.igGridUpdating({ columnSettings: [ { columnKey: "combo", editorOptions: { valueChanged: function (evt, ui) { // Get the selected value from the combo box var selectedValue = ui.owner.value(); // Get the row index of the combo box cell var rowIndex = ui.owner.rowIndex(); // Get the cell element of the text column in the same row var textCell = grid.igGrid("getCellText", rowIndex, "text"); // Update the text of the text cell with the selected value textCell.text(selectedValue); } } } ] });I assume that you have an IgGrid with two columns: "Combo Box" and "Text". When the value of the combo box changes, the
valueChangedevent is triggered. Inside the event handler, we retrieve the selected value from the combo box, the row index of the combo box cell, and the cell element of the text column in the same row. Finally, we update the text of the text cell with the selected value.Make sure to replace
#gridwith the actual ID of your IgGrid, anddatawith your actual data source.