1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    129
    Vote Rating
    0
    blay is on a distinguished road

      0  

    Default EditorGrid validation

    EditorGrid validation


    Hello:

    I´ve tried some things but nothing seems to work.
    My case is, I have an editorGrid with several columns (only one of them is really editable). I want that, if possible, dinamically, when they fill the value in the editable cell, and tabulate to the next one, if the value entered isn´t correct (there's a bottom limit and top limit values, which are showed in the grid too) that cell is marked as invalid with my own error message. Another possibilty I ´d like it´s to check this all when clicking a 'submit' button.
    And I´d like to know if it's possible to change the background color of that cell to red just when the cell is invalid.
    I´ve been searching for options but it seems i got blocked here...

    thanks

  2. #2
    Sencha User
    Join Date
    Oct 2010
    Posts
    129
    Vote Rating
    0
    blay is on a distinguished road

      0  

    Default


    I´ve found that I can manage if the value is right by adding a listener to the ValidatEdit Event...
    But how can I change the background color (or another style attribute of that specific cell? )

    Thanks

  3. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You can for example listen to the ValidateEdit event of the editorgrid, validate the value in that event and if it is not valid, restart editing and show a tooltip.

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Posts
    129
    Vote Rating
    0
    blay is on a distinguished road

      0  

    Default


    My goal is show a message like when a field is not valid (with the exclamation imagen and so) . I can get the cell by grid.getView().getCell(row,col).I´ve used setInnerHTML to change color of the font , even add the 'title' attribute, so when you put the pointer on the content of the field a text is showed, but what I want is just show the validation messages of form fields of GXT.

    Any idea or help? Thanks

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    1
    Vote Rating
    0
    capricio is on a distinguished road

      0  

    Default How was this eventually resolved?

    How was this eventually resolved?


    Other threads redirect here, yet this remains unanswered. How is this accomplished?

    I cannot get a rejected edit to return the cell to the pre-edit state tried the following in a listener for the ValidateEdit event

    record. :
    cancelEdit
    cancelBubble
    reject(true/false)

    (beginEdit();set(p,oldValue);setValid(p,true);endEdit(); )

    is the event thrown to late to cancel the edit?

    how can I intervene?

Similar Threads

  1. EditorGrid validation plugin
    By jsakalos in forum Ext 2.x: User Extensions and Plugins
    Replies: 35
    Last Post: 12 Jul 2012, 6:13 AM
  2. validation of Ext.form.Datefield in the editorGrid
    By c_ankit in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 30 Mar 2009, 1:55 AM
  3. [FIXED] Validation tootips on cells in EditorGrid
    By hbrands in forum Ext GWT: Bugs (1.x)
    Replies: 1
    Last Post: 28 Oct 2008, 12:05 PM
  4. EditorGrid: Whole record client-side validation?
    By jsakalos in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 8 Jun 2007, 6:00 PM

Thread Participants: 2