Results 1 to 4 of 4

Thread: Store.Find

  1. #1

    Default Store.Find

    I was checking the api and some of the threads, and I couldn't seem to have found my answer.

    I was wondering if there was a way that store.find would look for a field that isn't equal to null or empty string?


    store.find("name",!null); -- this code doesn't seem to be working for me

    cause I just need to know if there's a null record?


  2. #2


    In fact you are looking for records with some condition

    so this code will return you all the records which has len of 'name' value equal to 3 as a MixedCollection:

    PHP Code:
    var mixedCollection store.queryBy ( function(record){ return record.get('name') && record.get('name').length === 3        }); 
    I've found that in documentation, keep learning and practicing and you will be available to find that yourself without someones help

  3. #3


    Thanks for the reply.

    Well I didn't used the query by cause I didn't need to get the record I just need to check if there's a record that has a name with a value. Which is why I opted to use Find that returns either 0 or -1.

  4. #4


    Remember that the store will only be searching through the list of records that it has, at this particular moment in time. It doesn't query the host to determine whether a record exists on the host.

    So, unless you have all of the records in your possession (e.g. ArrayStore), you may need to issue an AJAX call to the host, asking it whether it has a qualifying record. The call will, of course, as always be asynchronous ...

Posting Permissions

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