jQWidgets Forums

jQuery UI Widgets Forums Grid CellEndEdit and newvalue

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • CellEndEdit and newvalue #58357

    Ridbark
    Participant

    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,
    Ridbark

    CellEndEdit and newvalue #58358

    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    CellEndEdit and newvalue #58362

    Ridbark
    Participant

    Hi 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,
    Ridbark

    CellEndEdit and newvalue #58363

    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    CellEndEdit and newvalue #58369

    Ridbark
    Participant

    Hi 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,
    Ridbark

    CellEndEdit and newvalue #58373

    Peter Stoev
    Keymaster

    Hi Ridbark,

    You can validate a cell value by using the validation function only.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.