PDA

View Full Version : edit grid size into contentpanel



LorenzoW
30 Jan 2007, 12:36 PM
Hi, I' ve created a page that has 2 regions:
north: with title and toolbar
center: with an edit grid

I need to make editgrid big as possible, I mean that edit grid should fit all the space of the region 'center'.
I tried many solutions, but no one it's ok, could someone help me?



<script type="text/javascript">
BodyLayout = function(){
var layout;
return {
init : function(){
layout = new YAHOO.ext.BorderLayout(document.body, {
hideOnLayout: true,
north: {
split:false,
initialSize: 70,
titlebar: false
},
center: {
split:true,
titlebar: false,
autoScroll:false
}
});
layout.beginUpdate();
layout.add('north', new YAHOO.ext.ContentPanel('intro', 'Intro'));
layout.add('center', new YAHOO.ext.ContentPanel('editor-grid', {title: 'Body', fitToFrame:true}));
layout.endUpdate();
}
}
}();
YAHOO.ext.EventManager.onDocumentReady(BodyLayout.init, BodyLayout, true);
</script>

</head>
<body>
<div id="intro">
<h1>Schema</h1>


...toolbar...</p>
</div>

<div id="editor-grid" style="border: 1px solid #cccccc; overflow: hidden; width: 100%; height: 100%;"></div>


thank you very much! :)

tryanDLS
30 Jan 2007, 12:47 PM
One of your solutions should be to use the search and/or read previous posts :)
Numerous people have asked this - use a gridpanel, it will fill the region.

LorenzoW
31 Jan 2007, 1:27 AM
oh, yessir.... :D
I' ve searched out and tryed...

I've used the grid panel, but a problem remains:
the vertical scrollbar is not visible!
(I mean, the grid can scroll, but I can see the scrollbar)

there is also another post about this, but nobody answered
(http://www.yui-ext.com/forum/viewtopic.php?t=2376&highlight=vertical)

This is the code I used:


dataModel = new YAHOO.ext.grid.XMLDataModel(schema);

...............................



grid = new YAHOO.ext.grid.EditorGrid('editor-grid', dataModel, colModel);



grid.trackMouseOver = true;

grid.addListener('rowdblclick', this.openDialog, this, true);


grid.getSelectionModel().clicksToActivateCell = 2;

grid.render();

dataModel.load('plants.xml');

},

......................

};

}();


BodyLayout = function(){

var layout;

return {

init : function(){

layout = new YAHOO.ext.BorderLayout(document.body, {

hideOnLayout: true,

north: {

split:false,

initialSize: 70,

titlebar: false

},

center: {

split:true,

titlebar: false,

autoScroll:false,

fitToFrame: false

}

});

EditorExample.init();

grid.autoSize();

layout.beginUpdate();

layout.add('north', new YAHOO.ext.ContentPanel('intro', 'Intro'));

layout.add('center', new YAHOO.ext.GridPanel(grid, {title: 'Body'}));

layout.endUpdate();

}

}

}();

LorenzoW
31 Jan 2007, 2:12 AM
Ok, I solved the problem including the style sheet feed-viewr.css of the examples.
I don't know why now it works, but it does!

metramaster
10 Jun 2008, 1:49 PM
where is this stylesheet you are talking about? which sample?