jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Changing "NumberInput" column properties after grid rendering
Tagged: number editor
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 1 month ago.
-
Author
-
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
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 StoevjQWidgets Team
http://www.jqwidgets.comHi 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?
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 StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.