Results 1 to 2 of 2

Thread: Doc bug: Ext.data.Store.contains() looks up by Id, not by object

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Feb 2012
    Posts
    82

    Default Doc bug: Ext.data.Store.contains() looks up by Id, not by object

    Docs for Ext.data.Store.contains() and also Ext.util.Collection.contains() both state that the collection is checked to see if it contains the supplied object.

    But in fact the collection is only checked to see if it contains an item with the same id as the supplied object.

    This is completely different, and has just tripped me up because I wanted to test an object that isn't necessarily the same type as those in the store.

  2. #2
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    569

    Default

    Hello Matt,

    Contains gets the key for the item passed and tries to map it to the collection. It maps with id and checks to see if the object is same.

    Check the source code : https://docs.sencha.com/extjs/6.5.2/...ethod-contains

    Regards,
    Kumar
    Sencha Support.

Similar Threads

  1. [object Object] when attempting to push Store data to a Carousel
    By wfillis in forum Sencha Touch 2.x: Discussion
    Replies: 1
    Last Post: 14 Feb 2014, 3:23 PM
  2. how a Ext.data.Model object access Ext.data.Store properties
    By vijayasarathi in forum Community Discussion
    Replies: 8
    Last Post: 5 Sep 2012, 9:36 AM
  3. Can not load data in store. Error: data is not object
    By Jaeger in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 6 Sep 2010, 1:04 AM
  4. How can I read data from a Ext.data.Store object
    By Hunterman in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 13 Aug 2009, 5:17 AM
  5. Accessing Data From An Ext.data.Store Object
    By RyanZec in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 29 May 2008, 11:04 AM

Posting Permissions

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