Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: can't see Toolbar

  1. #1

    Default can't see Toolbar

    Hi,

    I have a extentend grid:
    PHP Code:
    RubrikGrid Ext.extend(Ext.grid.GridPanel, {
        
    loadMask true,
        
    initComponent : function() {
               var 
    RubrikFilters = new Ext.grid.GridFilters({
                
    filters: [{
                    
    type'string'
                    
    }, {
                        
    type'string',
                        
    dataIndex'name'
                    
    }]
            });    
            
            var 
    RubrikStore = new Ext.data.JsonStore({
                      
    autoLoad true,
                   
    url'../services.php?class=RemRubrikService&method=listFilteredRubriken&filter=',
                   
    root'data',
                   
    totalProperty'totalCount',
                   
    id'id',
                   
    fields: [
                       
    'name','beschreibung''farbcode'
                   
    ]
            });

           
               var 
    sm = new Ext.grid.CheckboxSelectionModel();
            var 
    cm = new Ext.grid.ColumnModel([
                   
    sm, {
                   
    dataIndex'name'
                   
    header'Rubrik'
                   
    width170,
                   
    id'name'
                   
    }, {
                       
    header""
                       
    width17
                    
    dataIndex:'farbcode',
                    
    cellActions:[{
                         
    iconIndex'farbcode'
                    
    }]
                 }
            ]);
            var 
    toolbar = new Ext.Toolbar( {
                    
    text'Alle',
                    
    handler: function(button e)  {
                                var 
    grid Ext.getCmp('rubrik_id');
                                
    grid.selModel.selectAll();
                            }
                    }, {                   
                        
    text'Keine',
                        
    handler: function(button e)  {
                            var 
    grid Ext.getCmp('rubrik_id');
                            
    grid.selModel.clearSelections();
                        }
                    }, {                   
                        
    text'markierte Rubriken',
                        
    id'delete_id',
                        
    disabledtrue,
                        
    menu: [loeschen]          
                    }, {
                        
    text'neue Rubrik',
                        
    handler: function()  {
                            
    RubrikForm Ext.getCmp('rubrik_form_id');
                            
    Ext.getCmp('detail_id').layout.setActiveItem('rubrik_form_id');
                            
    RubrikForm.doLayout();
                            
    RubrikForm.setTitle('neue Rubrik anlegen');
                        }
            }
            );
               
    Ext.apply(this, {
                
    bbartoolbar,
                
    autoScrolltrue,
                
    viewConfig: {
                       
    forceFit:true
                   
    },
                
    cmcm,
                
    plugins:[RubrikFilters],
                 
    stripeRowstrue,
                
    splittrue,
                
    waitMsgTargettrue,
                
    iconCls'grid',
                
    storeRubrikStore,
                
    borderfalse,
                
    width340,
                
    height230
               
    }
               );
               
    RubrikGrid.superclass.initComponent.apply(this,arguments);
    // eo function initComponent
    });
    Ext.reg('rubrikgrid'RubrikGrid); 
    But I don't see the Toolbar even though my unit tests passes:

    PHP Code:
    assertEquals('toolbar'grid.getBottomToolbar().getXType()); 
    Thanks Torsten

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    looks ok at a glance, suggest you post working showcase using your extension:
    http://extjs.com/learn/Ext_Forum_Hel...rking_showcase

    Use local dummy data.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Read your code

    Code:
    var toolbar = new Ext.Toolbar( {
    
                    text: 'Alle',
    
                    handler: function(button , e)  {
    
                                var grid = Ext.getCmp('rubrik_id');
    
                                grid.selModel.selectAll();
    
                            }
    
                    }, {
    That is not javascript.

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Quote Originally Posted by Animal View Post
    Read your code

    Code:
    var toolbar = new Ext.Toolbar( {
    
                    text: 'Alle',
    
                    handler: function(button , e)  {
    
                                var grid = Ext.getCmp('rubrik_id');
    
                                grid.selModel.selectAll();
    
                            }
    
                    }, {
    That is not javascript.
    yeah it is . it's the same as:


    new Ext.Toolbar( arg1, arg2,arg3)

    or

    new Ext.Toolbar({}, {},{})

  5. #5
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    It's just not *valid* syntax for the toolbar.

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Ah yes, I see. I was thrown by the bad indenting.

  7. #7

    Default



    thanks Animal

    but why is the unit test running ?

  8. #8
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    Why don't you just set a breakpoint where the instance of toolbar is created. You should quickly find out why your config is wrong.

  9. #9
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Or how about reading the API or looking at examples? Toolbar expects an array of objects



    Code:
    var toolbar = new Ext.Toolbar( [{
    
                    text: 'Alle',
    
                    handler: function(button , e)  {
    
                                var grid = Ext.getCmp('rubrik_id');
    
                                grid.selModel.selectAll();
    
                            }
    
                    }, ....... More objects .........]);

  10. #10

    Default

    yes thanks guys sorry for that. It is working now!

    but still wondering why the unit test passed

Page 1 of 2 12 LastLast

Posting Permissions

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