Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default != Selector (not equals) doesn't work

    != Selector (not equals) doesn't work



    Ext version tested:
    • Ext 4.1.1.rc1
    Browser versions tested against:
    • FF16
    Description:
    • Query a form panel for fields that do not match an attribute
    Steps to reproduce the problem:
    • var results = form.query("field[inputType!='hidden']");
    The result that was expected:
    • an array with all the fields that are not inputType "hidden"
    The result that occurs instead:
    • returns an array of only the fields with inputType "hidden"
    • in other words the same as :
    • var results = form.query("field[inputType='hidden']");
    Test Case:

    http://jsfiddle.net/dbVdJ/

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,112
    Vote Rating
    504
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    This isn't a bug, the != operator isn't defined, nor it is listed in the docs. Similar to css selectors, it's intended that you use the :not selector:

    Code:
    cq.query(':not([hidden])');
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default


    Thanks for your reply.


    Unfortunately it is listed in the documentation:

    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Query

    E[foo!=bar] attribute "foo" does not equal "bar"

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,112
    Vote Rating
    504
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    dom.Query and ComponentQuery are not the same thing.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default


    My bad...

    But your example returns all the fields

    http://jsfiddle.net/dbVdJ/2/



    Code:
    form.query(":not([hidden])");
    or
    Code:
    form.query("field:not([hidden])");

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,112
    Vote Rating
    504
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Yes, I just copied that from the code somewhere, you'd still need to check the inputType.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default


    excellent thank you

    Here is the solution:


    Code:
    form.query("field:not([inputType=hidden])");

  8. #8
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default


    just for others:

    multiple chains (i.e. not hidden and not label = "hello2"):

    form.query("field:not([inputType=hidden]):not([fieldLabel='hello2'])");

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar