0
votes

I am developing an application in extjs 4 mvc. I have a problem with the scroll bars. None of my extjs components renders a slim scroll bar. All the components only renders a ugly browser scroll bar.

Ext.define('Complaints.view.ComplaintGrid',{
    extend: 'Ext.grid.Panel',
    alias: 'widget.complaintgrid',
    id: 'complaintGrid',
    cls: 'custom-complaint-grid',   
    store: 'Complaints',

    columns :
    [
        {header: 'Date', dataIndex: 'Date', width: 200},
        {header: 'Data 1', dataIndex: 'data1', width: 200},
        {header: 'Data 2', dataIndex: 'data2', flex: 1},
        {header: 'Complaint', dataIndex: 'Complaint', width: 150},              
    ]   
})

This is the code of one of the grid panels i have in my application. There are two problems with this.

  1. The vertical scroll bar isnt a slim scroll
  2. An unnecessary horizontal scroll bar appears

I have fit this grid inside a container. Code below.

Ext.define('Complaints.view.CenterPanel',{
    extend: 'Ext.panel.Panel',
    alias: 'widget.centerpanel',
    cls: 'custom-complaint-grid',
    id: 'centerPan',
    bodyStyle: "padding-left: 20px; padding-top: 10px; padding-right: 15px; background-color:#fff",
    layout: 'card',
    requires: [        
        'Complaints.view.ComplaintGrid', 
        'Complaints.view.ComplaintChart'
    ],
    initComponent: function(){       
        this.tbar = [{height: 50},'->',
            {
                    xtype: 'component',
                    cls: 'topDockTwoBtn',
                    width: 107,
                    height: 40
            },      
            {
                    xtype: 'component',
                    cls: 'topDockSixtyBtn',
                    width: 103,
                    height: 40,                    
            },
            {
                    xtype: 'component',
                    cls: 'topDockOneBtn',
                    width: 105,
                    height: 40
            },
            {
                    xtype: 'component', 
                    cls: 'topDockSrchBtn',
                    width: 72,
                    height: 40
            }
        ];

        this.items = [
            {
                xtype: 'complaintgrid'
            },
            {
                xtype: 'complaintchart'
            }
        ];

        this.bbar = [{height: 50},'->',
            {
                xtype: 'image',
                cls: 'btmDockChrtBtn',
                id: 'chartbutton',
                width: 53,
                height: 40,
                listeners: {
                    el: {
                        click: function() {
                            console.log('click reg');
                            Ext.getCmp('centerPan').getLayout().setActiveItem(1);
Ext.getCmp('centerPan').doLayout();
                            Ext.getCmp('chartbutton').addClass('btmDockChrtBtn-active');
                            Ext.getCmp('gridbutton').removeCls('btmDockGrdBtn-active');
                        }
                    }
                }
            },
            {
                xtype: 'component', 
                cls: 'btmDockGrdBtn',
                width: 58,
                height: 40,
                id: 'gridbutton',
                listeners: {
                    el: {
                        click: function() {
                            console.log('click reg');
                            Ext.getCmp('centerPan').getLayout().setActiveItem(0);
Ext.getCmp('centerPan').doLayout();
                            Ext.getCmp('gridbutton').addClass('btmDockGrdBtn-active');
                            Ext.getCmp('chartbutton').removeCls('btmDockChrtBtn-active');                       
                        }
                    }
                }
            }                
        ];                              
        this.callParent();
    }   
})

Also i have played around with the CSS and overridden some of the classes of the grid panel to make it look like how i want it to be. Any ideas why im getting an horizontal scroll bar and not getting a slim bar in the vertical.

1
I have noticed when using Chrome Canary a while back that all slim scollbars have been replaced by normal ones (slim scrollbars showed in the standard Chrome version). I would conclude that this is a browser affair.Izhaki
I think it is a browser related choice. My scrollbars seem to match whichever browser I'm usingdougajmcdonald

1 Answers

0
votes

You have to use jScrollPane or fleXcroll: Cross Browser Custom Scroll Bar.