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.
- The vertical scroll bar isnt a slim scroll
- 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.