iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am using Calculator custom editor in one of columns of webgrid. I want to be able to manually type in the period operator (.) in that column for decimal values but its not allowing me. I can pick that decimal point from dropdown of calculator editor though. I checked Calculator.js in EditorPack1 and it seems its returning false if( e.keycode == 115) which is for period and greater operators. Please suggest some workaround for this.
Thanks,
Sukhdeep
There are a number of complications that maybe caused by the period or comma, which is why I think the developer prevented in the first place.
By allowing user to input period (“.”) character, the calculator is no longer type safe. This means that users may input an invalid number that produces an error when calculated.
For example: 17..1 + 44.1.9.
So, accepting the period will need more advanced masked input such as those available in WebInput of UXMaskedInput.
However, if you feel that you can manage the errors, I can suggest you to make a minor modification to the Calculator.js file in EditorPack1. Please find and modify the code shown in the following snippet code.
Original code:
... if (!((48<=e.keyCode && e.keyCode<=57) || (96<=e.keyCode && e.keyCode<=105) || e.keyCode == 115 || e.keyCode==32 || e.keyCode==8 || e.keyCode==37 || e.keyCode==39)) { e.cancelBubble = true; e.returnValue = false; } ...
Modified to:
... if (!((48 <= e.keyCode && e.keyCode <= 57) || (96 <= e.keyCode && e.keyCode <= 105) || e.keyCode == 115 || e.keyCode == 32 || e.keyCode == 8 || e.keyCode == 37 || e.keyCode == 39 || e.keyCode == 110 || e.keyCode == 190)) { e.cancelBubble = true; e.returnValue = false; } ...
keyCode for the period character, 110 and 190, is added into the "if" conditional code.
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname