jQuery UI Widgets Forums Grid Issue with Validation when sorted

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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Issue with Validation when sorted #67304

    mithilsrivastav
    Participant

    Hi,

    I have applied a validation for a field where the user is not allowed to leave the cell blank.
    Validation works perfectly fine when i move to another cell or press buttons outside grid.
    But when i click on sort/page_change/filter, i do not receive a validation error.

    Any pointers would be appreciated.

    Regards,
    Mithil.

    Issue with Validation when sorted #67321

    Nadezhda
    Participant

    Hello Mithil,

    Please, provide us with a code sample or JSFiddle so we can test to determine the source of the issue.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

    Issue with Validation when sorted #67334

    mithilsrivastav
    Participant

    Hi Nadezhda,

    Please refer below fiddle link based on http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/cellediting.htm:
    http://jsfiddle.net/8gUGD/117/

    Steps to reproduce:
    Edit the “Quantity” field and set the value to “-1” and sort by Quantity (By clicking the “Quantity” column header), notice that it sorts and the validation is not seen, whereas if you click anything else except sorting the message is shown.

    This behavior is seen during pagination and filtering too.

    Regards,
    Mithil.

    Issue with Validation when sorted #67350

    Nadezhda
    Participant

    Hi Mithil,

    The validation message is displaying when you try to unselect the cell with invalid value.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

    Issue with Validation when sorted #67359

    mithilsrivastav
    Participant

    Hi Nadezhda,

    We are using jQWidgets version 3.6.0.

    Just to confirm we are on the same page.
    As mentioned, sorting is working fine. My concern is, we should not allow sorting since data is invalid.
    Can we display a validation message once you click on sorting and prevent sort functionality?

    I will still update the latest version(3.7.0) and see if this issue persists.

    Regards,
    Mithil.

    Issue with Validation when sorted #67367

    Nadezhda
    Participant

    Hi Mithil,

    You can sort the Grid only if your data is valid. When you set cell value to “-1” in Quantity column this value is invalid and the grid cell is still in edit mode. If you want to set cell value the cell should not be in edit mode so you can not display a validation message and prevent sort functionality.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

    Issue with Validation when sorted #67411

    mithilsrivastav
    Participant

    Hi Nadezhda,

    As you mention sorting happens only if data is valid.
    What is seen is when you type -1 in quantity, it shows a validation error which is invalid data.
    While validation error is seen, if you click on sort, sort happens. Ideally it should not since data is invalid.

    I would expect the validation message to be displayed and sort should not be allowed.

    Regards,
    Mithil.

    Issue with Validation when sorted #67419

    Nadezhda
    Participant

    Hi Mithil,

    If you want to set new value to the grid cell you should input valid data in other case this cell will be in edit mode and the invalid data will not be saved in the cell. When you try to sort the grid and you have invalid data in a cell this cell will have the previous valid data and is still in edit mode.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

    Issue with Validation when sorted #67539

    mithilsrivastav
    Participant

    Thanks for the help Nadezhda,

    Just to confirm, current functionality is that user is allowed to sort even if the there is invalid data.

    Regards,
    Mithil.

    Issue with Validation when sorted #67544

    Peter Stoev
    Keymaster

    Hi Mithil,

    That is not like that. In the current version, Sorting is allowed in any column. If you enter Invalid Data and your Validation does not pass and you Sort the column, the Cell will be still in Invalid State and the Editor will not be closed until you enter Valid Data. That will not stop you to Sort the Grid and the Grid will use the Cell’s Data before you Opened the Editor. The reason is that While Your Cell is in Edit mode, No data is Saved in the Cell so it always has Valid data.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.