Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default naming conventions: id, xtype

    naming conventions: id, xtype


    Common naming convention for xtypes?
    Just curious of any naming conventions being used for id's versus xtype. I had an inclination to use the same name.

    Code:
       items: [{
          xtype: 'panel-login',
          itemId: 'loginPanel',
          id: 'loginPanel',
          region: 'north',
          height: 50
       },
    Doesn't make a hill of bean difference, just thought I would see if there's a common convention floating around which if nothing else might make user extensions (xtype registrations) more uniform.

    I haven't tracked down what the problem is yet, but if you use the same id and xtype name it causes problems. For example, using something like:
    Code:
       items: [{
          xtype: 'loginPanel',
          itemId: 'loginPanel',
          id: 'loginPanel',//note I match the xtype
          region: 'north',
          height: 50
       },
    and then doing
    Code:
    Ext.getCmp('loginPanel')
    results in:
    Ext.getCmp('loginPanel') has no properties

  2. #2
    Ext JS Premium Member cdomigan's Avatar
    Join Date
    Mar 2007
    Posts
    148
    Vote Rating
    1
    cdomigan is on a distinguished road

      0  

    Default


    By matching the id to the xtype you are restricted to one instance of that class...

    And in your example Ext.getCmp() is looking for "'loginPanel'" instead of 'loginPanel' so it won't find it.

  3. #3
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by cdomigan View Post
    And in your example Ext.getCmp() is looking for "'loginPanel'" instead of 'loginPanel' so it won't find it.
    You are right, but that was just a typo making the forum post. I corrected that typo. Error still applies if you have an id and xtype that match. But not to get off topic, I was essentially interested if there was any convention for xtype naming of user extensions etc.

    We're all using our own namespaces like good coders, but if we're sharing code in the community seems like there might be a good standard to go by so our xtypes don't get clobbered by others...or are easily intuitive, etc.

  4. #4
    Sencha User Lobos's Avatar
    Join Date
    Oct 2007
    Location
    Sao Paulo, Brazil
    Posts
    461
    Vote Rating
    -1
    Lobos is an unknown quantity at this point

      0  

    Default


    I try to steer clear of using ids as much as possible, there are akin to global variables in my opinion. using getId() or itemId and getComponent does the job for me in virtually every scenario i come across.

    in regards to xtype naming, the norm seems lowercase without word separation which is a bit contradictory to the class naming convention which seems to be captial for new words. although i think i recall looking in the code and seeing that teh xtype is actually formatted to lower case so it doesn't matter if you use capitals to separate words for xtype

    and really xtype doesn't really have anyting to do with id, it is the name of the class / method being called - in your exmaple above it holds relavence, but when you think of a more generic type like xtype: 'panel' it does not seem so relevent

Thread Participants: 2