1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    0
    durgaprasadn is on a distinguished road

      0  

    Default rowedit plugin. validate data entered in grid/w/database before inserting into store

    rowedit plugin. validate data entered in grid/w/database before inserting into store


    Hello Team,

    I have gone through the examples of writing the grid data to database. First, we are inserting into the store and then store.sync is making a proxy call to write into the database etc.

    I have a requirement to validate the entered data in the grid for addition of new values or editing the values against the database to check whether already such values exists. If such value already exist, then it should prompt a message returned from the server saying such value already exists in the database to the user and ask him to either change the entered values or cancel the existing entry.

    How to acheive the above stated functionality.

    --Durga

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can return success as false to tell the store the sync was no successful.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    0
    durgaprasadn is on a distinguished road

      0  

    Default


    Does the store expect return type like this when sync is being called for create/update. Sorry for asking the basic question but I am not sure.

    {"success":"true"}

    and {"success":"false"}

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    true/false should be bools not strings

    Code:
    { "success": false }
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    0
    durgaprasadn is on a distinguished road

      0  

    Default


    Thank you sir for the quick reply. I appreciate it.

    One more basic question, how do we give at the UI the correct error message that the server provides in addition to success boolean value of true and false.

    --Durga

Thread Participants: 1