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
    Sencha User
    Join Date
    Mar 2008
    Posts
    82
    Vote Rating
    0
    safewolf is on a distinguished road

      0  

    Default Extend a own class, how to have own property?

    Extend a own class, how to have own property?


    if i extend a own class like this

    Code:
    OwnClass = function(){
       .......
    }
    
    Ext.extend(OwnClass, Ext.someclass)
    how to add my own property so that i can instant like this

    Code:
    new OwnClass({MyProperty1:property1,MyProperty2:property2})

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,632
    Vote Rating
    581
    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


    Code:
    Foo = Ext.extend(Bar,
    {
       prop1: 'foo',
       prop2: 'bar',
    
       //others
    }
    );
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Mar 2008
    Posts
    82
    Vote Rating
    0
    safewolf is on a distinguished road

      0  

    Default


    i have tried this,but i can't set the value of the properties,
    this is my code:

    Code:
    MyPanel = function(){
    	 MyPanel.superclass.constructor.call(this, {
    	 title: "ddd",
    	 height: 400,
    	 width:500
    	 });
    	 
    	 }
    	 
    Ext.extend(MyPanel, Ext.Panel,
    	{
    		mystr : "string_1"
    	}
    
    );
    
    
    Ext.onReady(function()
    {
    	panel = new MyPanel({mystr : "string_2"});
    	alert(panel.mystr);
    	panel.render("my-div");
    }
    
    );
    when "panel.mystr" is alerted,it's still "string_1",haven't changed to the given "string_2"

  4. #4
    Sencha User
    Join Date
    Mar 2008
    Posts
    82
    Vote Rating
    0
    safewolf is on a distinguished road

      0  

    Default


    found the problem

    the given properties should be applied before use

    so the code should be:

    Code:
    MyPanel = function(config){
          Ext.apply(this, config);
    	 MyPanel.superclass.constructor.call(this, {
    	 title: "ddd",
    	 height: 400,
    	 width:500
    	 });
    	 
    	 }
    	 
    Ext.extend(MyPanel, Ext.Panel,
    	{
    		mystr : "string_1"
    	}
    
    );
    
    
    Ext.onReady(function()
    {
    	panel = new MyPanel({mystr : "string_2"});
    	alert(panel.mystr);
    	panel.render("my-div");
    }
    
    );

  5. #5

Thread Participants: 2