Results 1 to 5 of 5

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

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    You can return success as false to tell the store the sync was no successful.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    0
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    true/false should be bools not strings

    Code:
    { "success": false }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    0
      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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •