Results 1 to 3 of 3

Thread: Check extjs object types

  1. #1
    Sencha User
    Join Date
    Nov 2008
    Posts
    114
    Vote Rating
    1
      1  

    Default Check extjs object types

    Hello!
    How to check if object is a extjs store?
    typeof() and Ext.type() returns only "object".

  2. #2
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966
    Vote Rating
    15
      2  

    Lightbulb

    Quote Originally Posted by tomlobato View Post
    Hello!
    How to check if object is a extjs store?
    typeof() and Ext.type() returns only "object".

    @tomlobato -- There are a couple of ways:

    PHP Code:
    var isStore = function(store){

       return 
    store && (store instanceof Ext.data.Store);

      
    //or pick a class method that any store should have
       
    return store && ('loadRecords' in store);
    };

    console.logisStore( new Ext.data.JsonStore() ) ); 
    Try it..
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3
    Sencha User
    Join Date
    Nov 2008
    Posts
    114
    Vote Rating
    1
      0  

    Default

    perfect!
    thank you, hendricd!

Posting Permissions

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