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
140
Hierarichal grid edit mode Dropdown Datasource
posted

Hi,

  How to bind Dropdown to diffrenet datasources based on condition in Hierarichal grid edit mode.

Thanks,

Kumar

Parents
  • 29417
    Offline posted

    Hello Kumar, 

    Thank you for posting in our forum. 

    You can use the editCellStarted event, which will fire when editing has started for a cell, get reference to the combo editor (ui.editor) and change its dataSource based on your condition .

    For example:

    editCellStarted: function(evt, ui){

                    if( ui.columnKey === "Name"){

                    var newData;

                    if(ui.rowID === 0){

                                    newData =[

                                    { "ID": 0, "Name": "Food1" },

                                    { "ID": 1, "Name": "Beverages1" },

                                    { "ID": 2, "Name": "Electronics1" }

                                    ];

                                   

                    }else {

                                    newData = northWindCategoriesJSON;

                    }

                                    var dropDown= ui.editor;

                                     //set New DataSource

                                    $(dropDown).igCombo("option", "dataSource",newData);         

                   

                    }

    }

     

    The above code will apply a different data source based on the edited row’s index for a column with key “Name”.

    I’ve attached a sample for your reference where this is applied for both the root and child levels.

     

    Let me know if you have any questions or concerns.

     

     

     

    Best Regards,

    Maya Kirova

    Infragistics, Inc.

    http://es.infragistics.com/support

     

    hgrid.zip
Reply Children
No Data