jQWidgets Forums

jQuery UI Widgets Forums Grid Changing "NumberInput" column properties after grid rendering

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 1 month ago.

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

  • andy8
    Participant

    Hello all,

    Is it possible to change properties of jqxNumberInput objects after grid was rendered. Let’s say we add a custom jqxNumberInput column like that:

    columns: [{
        text: 'Factors',
        datafield: 'factors',
        width: 80,
        columntype: 'custom',
        createeditor: function (row, cellvalue, editor, cellText, width, height) {
            editor.jqxNumberInput({
                decimalDigits: 4,
                inputMode: 'simple',
                max: 0,
                min: 1,					
                theme: theme,
                value: 0,
                spinButtons: true,
                spinMode: 'advanced'
            });
            .....
            }......

    Then, after the grid has been rendered, I wanted to change min-max limits programmatically. Is it doable?

    Thanks


    Peter Stoev
    Keymaster

    Hi andy8,

    initeditor is called each time the editor is opened. If you want to dynamically change editor settings, that’s the callback function which you should use.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    andy8
    Participant

    Hi Peter,

    Thanks – do you mean something like this?

    columns: [{
        text: 'Factors',
        datafield: 'factors',
        width: 80,
        columntype: 'custom',
        createeditor: function (row, cellvalue, editor, cellText, width, height) {
            editor.jqxNumberInput({
                decimalDigits: 4,
                inputMode: 'simple',
                max: 0,
                min: 1,					
                theme: theme,
                value: 0,
                spinButtons: true,
                spinMode: 'advanced'
            });
            },
        initeditor: function (row, cellvalue, editor, celltext, pressedkey) {
                editor.jqxNumberInput({
                    decimal: parseFloat(cellvalue),
                    max: GlobalMin,
                	min: GlobalMax,					
                });
        }, 

    and define vars GlobalMin and GlobalMax globally?


    Peter Stoev
    Keymaster

    Hi andy8,

    It is your own decision how to implement “initeditor”. I mean that, if you want to update dynamically an editor, then you should use “initeditor”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.