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
375
Get event of checkbox in rowEditStarted
posted

Hello everybody!

I am using a grid with the mode row edit. 

When I start to edit a row, there are a checkbox and a combobox (among other fields).

What I would like to do, while editing the row :

  •  When the checkbox is unchecked, the combobox is disabled
  •  When the checkbox is checked, the combobox is enabled

How detect the event of change or click of the checkbox?

Thanks,

  • 375
    posted

    Re,

    I found how do it.

    Based on http://ko.infragistics.com/community/forums/p/81039/408865.aspx#408865, instead of $(editor).data("igEditor").options.valueChanged, the code is rather: 

    [...]

    editRowStarted : function(evt, ui)
    {

    $( ui.owner.editorForKey("valBoolean")).on("click",function(evt, args)

    {
    if($(ui.owner.editorForKey("valBoolean")).find(".ui-igcheckbox-small-off").length != 0)
    {
    valCheckBox = false;
    $("#comboCountries").igCombo("selectedIndex", -1);
    }
    else
    {
    valCheckBox = true;
    }
    });

    [...]

    columnSettings :

    {

    columnKey: "Countries",
    editorType: "combo",
    editorOptions: {
    id: "comboActivities",
    mode: "dropdown",
    dataSource: source,
    multiSelection : "onWithCheckboxes",
    textKey: "txtCountry",
    valueKey: "valueCountry",
    dropDownOpening : function(){
    return valCheckBox;
    [..]

    }

    Hope it may be useful to other users.