jQWidgets Forums
jQuery UI Widgets › Forums › Angular › Not able to copy number to jqxnumberinput
Tagged: "ctrl + v" issue
This topic contains 6 replies, has 2 voices, and was last updated by ilywanzi 5 years ago.
-
Author
-
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.Hello ilywanzi,
I have tested the following Example and it is working fine.
Selecting a cell from theQuantity
column and pasting a numeric value by pressing “ctrl + v” successfully updates the cell.Best Regards,
MartinjQWidgets Team
https://www.jqwidgets.com/Hi, Martin, thanks for you reply.
Could you please check theQuantity
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’seditor.jqxNumberInput
, if I don’t setdecimalDigits
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, anddecimalDigits === 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.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,
MartinjQWidgets Team
https://www.jqwidgets.com/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?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,
MartinjQWidgets Team
https://www.jqwidgets.com/Hi, Martin, thanks for you help, but I have combined textbox and its validation to implement the similar function, thanks.
-
AuthorPosts
You must be logged in to reply to this topic.