PDA

View Full Version : Problem with hidden column in grid



manugoel2003
17 Dec 2006, 3:07 AM
hi Jack,

i have used colModel.setHidden(0,true); in my code. After using this method grid nevigation stop working. i have tried {header: "Ticket No1.", width: 220, sortable: true, hidden: true} also but the same output. could you please help me.

var schema = {
root: 'rows',
id: 'ticket_id',
fields: ["ticket_id1", "cr_date2", "status_id", "category"]
};
dataModel = new YAHOO.ext.grid.JSONDataModel(schema);
var colModel = new YAHOO.ext.grid.DefaultColumnModel([
{header: "Ticket No1.", width: 220, sortable: true, hidden: true},
{header: "Date of Creation", width: 220, sortable: true},
{header: "S", width: 220, sortable: true},
{header: "Category", width: 220, sortable: true}
]);
dataModel.setDefaultSort(colModel, 2, 'DESC');



// create the Grid
var grid = new YAHOO.ext.grid.Grid('content', {
dataModel: dataModel,
colModel: colModel,
monitorWindowResize: true,
stripeRows: false,
trackMouseOver: true
});
grid.render();

//Manish Resize Grid Columns
dataModel.addListener('load', function(){
grid.getView().autoSizeColumns();
grid.getView().getPageToolbar();
}, true);


dataModel.load('json1.js');

jack.slocum
17 Dec 2006, 3:35 AM
Can you put up a link?

Also, will you try commenting out the call to "autoSizeColumns()" and seeing if it's still broken.

manugoel2003
17 Dec 2006, 4:15 AM
Thanks for your quick response.

i did the same but no success (//grid.getView().autoSizeColumns(); ).

I have uploaded the sample application on http://egov.e11online.com/sample.htm

Regards,
Manu

jack.slocum
17 Dec 2006, 12:12 PM
The site won't load for me. No response?

manugoel2003
17 Dec 2006, 9:21 PM
Try refreshing it a couple of times. Might be a server problem. I have checked the link again.

manugoel2003
17 Dec 2006, 11:07 PM
I have uploaded it in another location anyways. So, now it is hosted on two locations.

http://egov.e11online.com/sample.htm
http://osscube.com/sample/sample.htm

jack.slocum
18 Dec 2006, 10:38 AM
Thanks for the second link. It looks good in FF but doesn't appear in IE. There are 2 possible problems I see:

You are calling for json1.js. IE is very flaky about content types and if they aren't right it will fail to load. It's very possible it is bombing here because of the extension .js is causing your server to return a content-type for javascript. I know it sounds dumb, but I would say 75% likely to be the problem.

grid.getView().getPageToolbar(); in the load handler will bomb since your data model doesn't use paging and therefore won't use a PagedGridView and so getPageToolbar won't exist.

manugoel2003
21 Dec 2006, 8:50 AM
thanx.... and sorry for the late reply.... actually I lost track of this post :)