jQuery UI Widgets Forums Grid Grid with jqxNumberInput Editor min/max

Tagged: ,

This topic contains 6 replies, has 3 voices, and was last updated by  admin 2 months, 3 weeks ago.

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

  • Klaus H
    Participant

    Hi,

    I am using a Grid with a built in jqxNumberInput as editor:

    var numberEditor = function (row, cellvalue, editor) {
    	editor.jqxNumberInput({ decimalDigits: 0, digits: 2, min: 0, max: 10, spinButtons: false, spinMode: '',  spinButtonsStep: 0 });
      };

    which then I include into the necessary columns with:
    columntype: ‘numberinput’, createEditor: numberEditor

    The problem is, that min and max are ignored when I enter data, I can enter any value with the keyboard contrary to an outside jqxNumberInput. If I activate the spinButtons and use them, the min and max values work for the editor. Did I overlook something? Is this by design?

    Best Regards
    Klaus H


    Klaus H
    Participant

    Hi,

    it works when I use the function cellvaluechanging for the columns and validate the value there. That seems okay and doable.

    Best Regards
    Klaus H


    Yavor Dashev
    Participant

    Hi Klaus,

    I was able to reproduce this case and this is not the expected behavior from the jqxNumberInput.

    I will add a work item for it we will work to fix it as soon as we can.

    Thank you for reporting this case!

    Please, do not hesitate to contact us if you have any additional questions.

    Best Regards,
    Yavor Dashev
    jQWidgets team
    https://www.jqwidgets.com

    • This reply was modified 3 months, 1 week ago by  Yavor Dashev.

    Klaus H
    Participant

    Hi Yavor,

    thanks for the feedback, I am looking forward to the moment that this works, but in my case I now have to stick to my solution because as I found out today there are gaps in which numbers are allowed, so a simple min max won’t help me here, but in other situations it might be very useful. 🙂

    Best Regards
    Klaus H


    Yavor Dashev
    Participant

    Hi Klaus,

    Actually I have tested creating a editor with the ‘initeditor’ callback and the jqxNumber input works as intended and validates min and max values.
    Quick code snippet for the initeditor:

      text: 'Quantity', width: 250, columntype: 'custom', datafield: 'quantity',
                        
                         initeditor: function (row, cellvalue, editor, celltext, pressedkey) {
                            
                            editor.jqxNumberInput({ decimalDigits: 0, digits: 2, min: 0, max: 10, spinButtons: false, spinMode: '',  spinButtonsStep: 0 });
                         },
                         geteditorvalue: function (row, cellvalue, editor) {
                           
                               return editor.val();
                         }
                     }

    Let me know if that works for you!

    Please, do not hesitate to contact us if you have any additional questions.

    Best Regards,
    Yavor Dashev
    jQWidgets team
    https://www.jqwidgets.com


    Klaus H
    Participant

    Hello Yavor,

    I tried this and it does work, but I still have a strange behaviour, I set min to 0 and max to 10, if I enter 11 it goes down to 10 but the editor stays active and pressing enter does not set the changed value. Like I wrote, I need another solution now because there can be gaps now so I have to validate the number anyway. But I am sure there will be another case with another grid in the future, then I will test this again.

    Best Regards
    Klaus H


    admin
    Keymaster

    Hi Klaus,

    We will do our best to improve that behavior in the upcoming versions of jqxGrid.

    Best regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.