PDA

View Full Version : EditorGrid horizontal scroll is not comming



sidd
31 Aug 2009, 4:13 AM
Hi,

I made a editable grid using editor grid . i have a lot of column. i need the horizontal scroll bar in the grid.
I searched through the forum but could not figure it out. Can any one help me??

My code is as below. (This is not the full code.)


App.user.Grid = Ext.extend(Ext.grid.EditorGridPanel, {
iconCls: 'silk-grid',
border: false,
//width: 800, // tried with this
initComponent : function() {

//typical viewConfig
this.viewConfig = {
forceFit: true, // tried with commenting this
enableRowBody:true
};

// relay the Store's CRUD events into this grid so these events can be conveniently listened-to in our application-code.
this.relayEvents(this.store, ['destroy', 'save', 'update']);

// build toolbars and buttons.
this.tbar = this.buildTopToolbar();

// super
App.user.Grid.superclass.initComponent.call(this);
}

// My grid
var userGrid = new App.user.Grid( {
store : store,
plugins: [editor],
cm: userColumns,
view: new Ext.grid.GroupingView({
forceFit:true,// tried with commenting this
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Tasks" : "Task"]})'
}),
bbar: new Ext.PagingToolbar({
pageSize: 5,
store: store,
displayInfo: true,
displayMsg: 'Displaying data {0} - {1} of {2}',
emptyMsg: "No data to display"
})
});

// My panel containing the grid
var mainPanel = new Ext.Panel({
id: 'all-tasks',
title: 'All Tasks',
region:'center',
margins:'5 5 5 0',
layout: 'fit',
bodyStyle:'background:#f1f1f1',
iconCls: 'all-tasks-icon',
items:[userGrid]
});
// My panel containing the panel
var viewport = new Ext.Viewport({
layout:'border',
items:[actionPanel,mainPanel]
});

Thanks,
Sidd

Animal
31 Aug 2009, 4:16 AM
What horizontal scrollbar?

You have explicitly asked for there never to be a horizontal scrollbar.

sidd
31 Aug 2009, 4:21 AM
Thanks for your reply .. but i am not able to get it properly.

R u talking about
layout: 'fit' in my panel or
forceFit: true in my grid ...

Can u clear it lil bit?

Thanks,
Sidd

Animal
31 Aug 2009, 4:32 AM
Well the layout: 'fit' Panel which you wrap around your Panel is completely pointless isn't it? What does it add?

Obviouslu forceFit does what it says in the API docs.

sidd
31 Aug 2009, 4:53 AM
Hi,

Thanks man.I its working.
I removed the forceFit.

Thanks,
Sidd