jQWidgets Forums

jQuery UI Widgets Forums Angular Not able to copy number to jqxnumberinput

This topic contains 6 replies, has 2 voices, and was last updated by  ilywanzi 5 years ago.

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

  • ilywanzi
    Participant

    Hi, I am using jqxnumberinput inside jqxgrid, and I have a copy-paste issue for it.
    I try to copy a number outside of the browser, then paste into the numberinput inside the grid, but pressing “ctrl + v” is not working. And also I disabled the grid’s default context menu, so there is no way to use the “paste” from context menu. But pressing “ctrl + v” is working in textinput.
    Please let me know how can I fix this issue, thanks.


    Martin
    Participant

    Hello ilywanzi,

    I have tested the following Example and it is working fine.
    Selecting a cell from the Quantity column and pasting a numeric value by pressing “ctrl + v” successfully updates the cell.

    Best Regards,
    Martin

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


    ilywanzi
    Participant

    Hi, Martin, thanks for you reply.
    Could you please check the Quantity column from this example: stackBlitz. This example can reproduce my problem:
    1. Can not paste number to “Quantity” column by “ctrl + v”;
    2. Inside Quantity’s editor.jqxNumberInput, if I don’t set decimalDigits property, I can not type decimal in it; but if if I set this property, when I click the grid cell, the number will always show with some zero. For example, if the grid cell value is 777, and decimalDigits === 5, when I click the cell, the number will be shown as 777.00000. Is there a way to do like this way: whatever number being loaded, always show the original number after click the grid cell. For example, if 44 is loaded, then only show 44 after click the cell; or if 44.5678 is loaded, then only show 44.5678. And also no digit limit when user edit the number.


    Martin
    Participant

    Hello ilywanzi,

    You could use the initeditor callback to check how many decimals the cell value has and set the decimalDigits property of the jqxNumberInput. However, then you would not be able to type more decimal values as this is fixed. You could check this Example.

    As for the “ctrl + v”, I’ve tested it in your example also and again it works.

    Best Regards,
    Martin

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


    ilywanzi
    Participant

    Hi, Martin, base on your solution,
    1. If the cell load an integer, then user can’t add decimal to this integer. Is there another way to handle this problem?
    2. About the paste problem, if I copy a number from another grid cell, that’s ok; but if I copy a number from outside of the grid, for example, from the browser dev tool console, the pasting is not working. Only if I use mouse right click then select “paste” in context menu, then it’s working. Could you please check?


    Martin
    Participant

    Hello ilywanzi,

    Unfortunately, there is no way to have dynamic count of decimals in jqxNumberInput.
    As for the pasting, I have tried to copy a number from both the dev tools and other editors and it is working fine. Have you tested it in the last Stackblitz example that I sent you?

    Best Regards,
    Martin

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


    ilywanzi
    Participant

    Hi, Martin, thanks for you help, but I have combined textbox and its validation to implement the similar function, thanks.

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

You must be logged in to reply to this topic.