1. #1
    zhiliang
    Guest

    Default Builder classes/Preconfigured Classes

    Builder classes/Preconfigured Classes


    hello everyone, i have a problem when i want to configure classes,

    for example, i create a class extends from combobox


    PHP Code:
        var releasestore = new Ext.data.Store({
               
    proxy: new Ext.data.HttpProxy({
               
    url'./php/backend.php',
                
    method'POST'
            
    }),
            
    baseParams:{task"showRelease"},
            
    reader:  new Ext.data.JsonReader({
                
    root'release'
                
    //root: 'results', 
                //totalProperty: 'total'
            
    }, [
                {
    name'appli'mapping 'Appli'},
                {
    name'release'mapping 'IdRelease'}   
                ])
        });
        
        
    Application.ComboRelease Ext.extend(Ext.form.ComboBox, {
         
    border:false
        
    ,initComponent:function() {      
            
    Ext.apply(this, {
            
    storereleasestore,
            
    displayField:'release',
            
    typeAheadtrue,
            
    //mode: 'local',
            
    triggerAction'all',
            
    emptyText:'Release',
            
    fieldLabel:'Release',
            
    selectOnFocus:true,
            
    width:100
            
    });
     
            
    Application.ComboRelease.superclass.initComponent.apply(thisarguments);
        } 
     
        ,
    onRender:function() {
            
            
    Application.ComboRelease.superclass.onRender.apply(thisarguments);
        } 
        });
     
        
    Ext.reg('ComboRelease'Application.ComboRelease); 
    it works well when i add to the panel , but in another function i need the selected value from this combobox,

    function PDFClick(btn){

    var item = ComboRelease.getValue();
    }

    then it will create an error, "ComboRelease not defined", so how can i use the classes i defined??


    the same problem when i create a toolbar, how can i use this function Mytoolbar.addField(comboPDFTpye);

    PHP Code:
    Application.Mytoolbar Ext.extend(Ext.Toolbar, {
       
        
    initComponent:function() {      
            
    Ext.apply(this, {
           
            });
     
            
    Application.Mytoolbar.superclass.initComponent.apply(thisarguments);
        } 
     
        ,
    onRender:function() {

            
    Application.Mytoolbar.superclass.onRender.apply(thisarguments);
        } 
        });
     
        
    Ext.reg('Mytoolbar'Application.Mytoolbar);



       
    Mytoolbar.addField(comboPDFTpye);

       
    Mytoolbar.add(
            {
            
    text'PDF',
            
    enableToggletrue,
            
    toggleHandlerPDFClick,
            
    pressedtrue
          
    }); 
    I am a beginner, really hope someone can help, thanks

  2. #2
    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


    You need to work with an instance of the class, not on the class itself.

    releasestore is a reference to an instance of a data.store class for example.
    You need to define an instance of Application.ComboRelease.

    PHP Code:
    var myComboRelease = new Application.ComboRelease(
       {
          
    //specify any overrides or required configs for your extension (if any)
       
    }
    );

    function 
    PDFClick(btn){
       var 
    item myComboRelease.getValue(); 


  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


    Are you working with Ext1? Would be better to work with Ext2, you posted in Ext 1 forum.

  4. #4
    zhiliang
    Guest

    Default


    really thanks sorry i post the wrong place, i use ext 2.x, now i understand how to use the builder classes

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi