Results 1 to 3 of 3

Thread: How to set validation on create/update

  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Sweden
    Posts
    11
    Vote Rating
    2
      0  

    Default Unanswered: How to set validation on create/update

    Hi!
    I couldn't find anywhere in docs if it's possible to say that validation rule (both for model or Row/CellEditing) should be applied only on creating record or on update. Have I missed something?
    Or what would be the way to go? Introduce some flag e.g in the grid and checking in custom validation function if the record is being created or updated?

    Thanks for any advice!
    Luk

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,389
    Answers
    716
    Vote Rating
    498
      0  

    Default

    Can you explain this a little more? Are you trying to validate editors in a grid and determine of you are adding or updating the record?

    Scott.

  3. #3
    Sencha User
    Join Date
    May 2012
    Location
    Sweden
    Posts
    11
    Vote Rating
    2
      0  

    Default

    Hi Scott,

    imagine two scenarios.
    1) using ordinary form and model validation of "Accept TOS" checkbox - this is typically validated only for creating new records
    2) in grid using Row/CellEditing plugin I have one text field which is required when inserting new record (for example: password), but not when editting (admin may or may not wish to change that field).

    So far I didn't find any configuration of validation rules for this or similar cases. Do you have any ideas?
    Thanks,
    Luk

Tags for this Thread

Posting Permissions

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