[CLOSED] Client Validation

  1. #1

    [CLOSED] Client Validation

    I have page which has a mix of controls (some EXT, some not). For the EXT ones, even though the controls are not in an EXT Form, is there a way to generically determine if the controls are in an "error" state - meaning, if a user has typed text in a date type control and the red error indicator is showing, I can generically test for (check something like "App.Errors" - not real, I know, but maybe something like that) on a button click without specifically calling control's function, adding a listner to the control, or looping through each control at button click.
    Last edited by Daniil; Sep 25, 2012 at 6:53 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use the ValidityChange event.
    http://docs.sencha.com/ext-js/4-1/#!...validitychange

    Quote Originally Posted by adelaney View Post
    or looping through each control at button click.
    A way of looping can depend how the fields are organized.

    The simplest way is to place them all into some Ext.NET Container and iterate the items collection.
    Container1.items.each(function (item) {
        alert(item.isValid());
    });
  3. #3
    When I use my container:

    App.searchForm.items
    It returns 0.

    However, if I use a jQuery statement:
     $("input")
    I get 71 items.

    Would it matter if the first child in my container is a div which has a fieldset where the inputs are children of the fieldset? Is there no generic sort of finding of EXT items as similar to jQuery?
  4. #4
    Is there no generic sort of finding of EXT items as similar to jQuery?
    You can use Ext.select.

    http://docs.sencha.com/ext-js/4-1/#!...-method-select

    Example

    Ext.select('input')
    Hope this helps.
    Geoffrey McGill
    Founder
  5. #5
    Quote Originally Posted by adelaney View Post
    Would it matter if the first child in my container is a div which has a fieldset where the inputs are children of the fieldset
    Then this <div> and its content doesn't become items of the container. It is rendered as raw HTML.

    I would consider a possibility to avoid this <div> and deal with the Items collection of the Container.

    Also I recommend to look into the Ext.ComponentQuery utility class.
    http://docs.sencha.com/ext-js/4-1/#!...ComponentQuery

Similar Threads

  1. [OPEN] [#100] Validation - Remote/Client
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Dec 29, 2012, 6:12 AM
  2. Client Side Validation and Validation Status
    By speddi in forum 1.x Help
    Replies: 8
    Last Post: Nov 03, 2011, 11:24 AM
  3. Replies: 3
    Last Post: Jul 11, 2011, 9:43 AM
  4. Form Panel Client Validation Problem
    By vivekrane1986 in forum 1.x Help
    Replies: 0
    Last Post: Jun 18, 2010, 9:26 AM
  5. Client & Server Side Control Validation
    By r_honey in forum 1.x Help
    Replies: 3
    Last Post: Dec 27, 2009, 5:16 AM

Tags for this Thread

Posting Permissions