jQuery UI Widgets › Forums › Grid › CellEndEdit and newvalue
Tagged: cellendedit, change, newvalue
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 2 months ago.
-
AuthorCellEndEdit and newvalue Posts
-
Hello,
I am trying to change the endcelledit() function to check the value and adapt the value.
For example, i need to have an int into my cell, but the user writes “537,” instead of “537”. I need to correct that before he closes the editor.
Why i use a textbox instead of a numberinput? Because the user can enter this style of calcul : “=500+37” instead of directly put “537”, so i need to resolve the addition “500+37” and put “537” in the cell.
But, if i change the value into the “cellendedit” function, your system changes my new value to the old “537,” …Any suggestion?
Best regards,
RidbarkHi Ridbark,
The “validation” function is for that purpose. It should be used for value validation
Example: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/cellediting.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I saw this function, “validation”, but if the value is not correct, can i change it and return the new value?
I see that validation function return only “true” or “false”, to say if the value is correct or not … it also can return a message, so it’s interesting when the value is wrong, like “537,” instead of “537”, but not if it’s “=500+37” !Best regards,
RidbarkHi Ridbark,
The purpose of the function is to inform your user that the entered value is incorrect with an appropriate message and the editor stays opened until a valid value is entered.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I know the purpose of the validation function, and it’s not what i need …
I need a function to modify the cell value at the end of the cell edit! But “cellendedit” doesn’t accept to change the value of the cell!
So what event can i implement to change in javascript the value of the cell, and so to evaluate “=500+37” and write “537” in the cell ?Best regards,
RidbarkHi Ridbark,
You can validate a cell value by using the validation function only.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.