Hello!
I have an igGrid and has 1 column that was configured with updating feature
Can you give me an example to change from texteditor to combo editor
Because with each row. I want to fill data with each other editor type
i used infragistics 15.2
Hello Cuong,
I assume you want to change the editor at runtime, based on some condition, right? To change the editor at runtime you need to change the columnSettings option like this:
$("#grid1").igGridUpdating("option", "columnSettings", [{columnKey: "col2", editorType: "combo", editorOptions: {dataSource: ["value1", "value2", "value3"]}}]);
You can do this in the igGridUpdating.editRowStarting event with the following code:
$("#grid1").on("iggridupdatingeditrowstarting", function (evt, ui) { // some condition to decide which editor to use for the row if (ui.rowID === 2) { $("#grid1").igGridUpdating("option", "columnSettings", [{columnKey: "col2", editorType: "combo", editorOptions: {dataSource: ["value1", "value2", "value3"]}}]); } else { $("#grid1").igGridUpdating("option", "columnSettings", [{columnKey: "col2", editorType: "text"}]); } // manually starting edit, because editRowStarting event fires at time which is too late to change editor types setTimeout(function () { $("#grid1").igGridUpdating("startEdit", ui.rowID); }, 100); return false; });
Hope this helps, Martin Pavlov Infragistics, Inc.
thank you very much.
i have an other question.
can i show more than 1 column with combo editor within igGrid
thank you very much!
Yes, you can. I'm attaching a sample.
Best regards,Martin PavlovInfragistics, Inc.
Thank you for your kind words. You're welcome.
thanks you very much.
it works fine with my case
you are a good developer
thank again!