jQWidgets Forums

jQuery UI Widgets Forums Grid Switch columntype property depending on row

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • cberube
    Member

    I would lime to switch column type from dropDownList and numberInput depending of the row.

    The setcolumnproperty method does not do it nor is the initeditor. Is there any alternative.

    $(‘#empGrid’).jqxGrid(‘setcolumnproperty’, ‘ABR’, ‘columntype’, ‘dropdownlist’);

    text: ‘Obj.’, datafield: ‘ABR’, hidden: false, width: ‘5%’, align: ‘center’, cellsalign: ‘center’, columntype: ‘dropdownlist’,
    createeditor: function (row, value, editor) {
    var mtc= prt.emp.getGroupValue(row);
    if (mtc != “3”) {
    $(‘#empGrid’).jqxGrid(‘setcolumnproperty’, ‘ABR’, ‘columntype’, ‘dropdownlist’);
    var index = parseInt(prt.emp.getMappedValues(value, mtc)) – 1;
    editor.jqxDropDownList({ source: empType1.records, displayMember: ‘label’, valueMember: ‘value’, closeDelay: 0, selectedIndex: index });
    }
    else {
    editor.jqxNumberInput({ decimalDigits: 2, digits: 1, inputMode: ‘simple’, min: 0, theme: theme, spinButtonsWidth: 10, spinButtons: false, spinMode: ‘simple’ });
    }
    }


    Peter Stoev
    Keymaster

    Hi cberube,

    You cannot switch the “columntype” property of a column. “setcolumnproperty” would not change that value which could be set only during the initialization.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.