Validation Design Impractical

6 posts, 1 answers
  1. Jeff
    Jeff avatar
    18 posts
    Member since:
    Jun 2012

    Posted 19 Jun 2012 Link to this post

    The current design of your validators requires you to build the validator directly into the view.  This information should instead be coming directly from the model and should be applied to the view via attributes applied by the model binding.  Designing it the way you have causes a great deal more coding than would otherwise required with model binding.  Is there any chance I can provide a speclet for how the validators should working using binding with the model to get this in the feature pipeline?

    Your friendly super high performance service guy,
    Jeff Fischer
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Jun 2012 Link to this post

    Hello,

    The Kendo Validator is built around HTML5 form validation. The same relies on HTML attributes which are indeed defined in the view.

     I guess you want Kendo MVVM to generate those attributes during MVVM binding based on the kendo.data.Model field declaration. Is that correct? 

     In any case you may consider creating a new item in our user voice page. We would prioritize it based on user demand.

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Jeff
    Jeff avatar
    18 posts
    Member since:
    Jun 2012

    Posted 20 Jun 2012 Link to this post

    It appears it's possible to utilize the model to control the validation.  It would be great to get a link from the Validator section over to the DataSource Model section to move people in that direction (it's likely a more useful implementation).  There's also pretty

    http://www.kendoui.com/documentation/framework/datasource/configuration.aspx#model

    Also, more detail documentation around the rules configuration structure would be very helpful.

    http://www.kendoui.com/documentation/framework/validator/configuration.aspx#rules

    The current documentation gives you no understanding of whether you can add more than one custom method off of the rules property or whether you're supposed to do all of your processing inside of the single custom method.

    Thanks,
    Jeff
  5. Answer
    Justin
    Justin avatar
    3 posts
    Member since:
    Feb 2012

    Posted 26 Jun 2012 Link to this post

    After doing some deeper searching, I came across this forum post that might prove helpful to all who want to do validation.

    http://www.kendoui.com/forums/framework/validation/unable-to-get-custom-validation-working-on-a-grid.aspx 

    Perhaps the admin can confirm, but this looks like it will work with all Kendo UI web widgets: 

    UI WIDGETS








     

     
    The only thing missing from making that page a complete resource is an answer on how to access the validators for each of the widgets, so that one can do things like check for accumulated errors, say for a logger, or getting a callback to confirm validation worked before performing other operations.
  6. Jeff
    Jeff avatar
    18 posts
    Member since:
    Jun 2012

    Posted 04 Jul 2012 Link to this post

    I added a UserVoice suggestion to be able to DataSource the model (with validation) and request it from the server rather than hard code it into the client.  Place your votes here - http://kendo.uservoice.com/forums/127393-kendo-ui-feedback/suggestions/2976821-datasource-model-separately-datasourcable.

    Thanks,
    Jeff
  7. Craig
    Craig avatar
    35 posts
    Member since:
    Feb 2012

    Posted 20 May 2013 Link to this post

    Although I see your point you are trying to make, I want to mention that moving the validation to the  viewModels (which is usually a good idea) or the data source would be counter-productive in the case of Kendo. The reason being is that many developers who use Kendo UI employ another method for managing their models other than the Kendo Datasource and Kendo MVVM. If all the validation was moved away from the opt-in validation Kendo provides into the MVVM or Datasource this would be tying developers into doing something many would prefer to do otherwise. This is highlighted by many of the project currently under development in labs.kendoui.com.

    I believe that if your are REALLY that concerned about how clean your data is, I suspect you should be putting Validation at each point along the way by way of keeping validation off the transport layer (which is one of the things the Datasource manages). Put validation on the server side on your 'real' models if you need that level of validation.

    Finally, I just wanted to mention that another very large software company 'forced' us into their 'validation on the models' in ASP.NET web-forms which (shockingly) really irritated a lot of developers by forcing them to do things and tying their hands from doing really neat 'other' things.

    Just my $.02, take it or leave it - I just wanted to put some food for thought on the table.

    -Cheers!
Back to Top
Kendo UI is VS 2017 Ready