Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1355
igGrid change from text editor to combo editor in igGrid 15.2
posted

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

Parents
  • 23953
    Verified Answer
    Offline posted

    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.

Reply Children
No Data