3 * @class Roo.bootstrap.panel.Grid
4 * @extends Roo.bootstrap.panel.Content
6 * Create a new GridPanel.
7 * @cfg {Roo.bootstrap.Table} grid The grid for this panel
8 * @param {String/Object} config A string to set only the panel's title, or a config object
10 new Roo.bootstrap.panel.Grid({
19 Roo.bootstrap.panel.Grid = function(config){
22 this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
23 {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
27 var tool_el = this.el.createChild();
28 this.toolbar = Roo.factory(this.toolbar);
29 this.toolbar.render(tool_el);
32 this.wrapper.dom.appendChild(config.grid.getGridEl().dom);
33 config.el = this.wrapper;
35 Roo.bootstrap.panel.Grid.superclass.constructor.call(this, config);
38 // xtype created footer. - not sure if will work as we normally have to render first..
39 if (this.footer && !this.footer.el && this.footer.xtype) {
41 var ctr = this.grid.getView().getFooterPanel(true);
42 this.footer.dataSource = this.grid.dataSource;
43 this.footer = Roo.factory(this.footer, Roo);
44 this.footer.render(ctr);
49 config.grid.monitorWindowResize = false; // turn off autosizing
50 config.grid.autoHeight = false;
51 config.grid.autoWidth = false;
52 this.grid = config.grid;
53 this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
58 Roo.extend(Roo.bootstrap.panel.Grid, Roo.bootstrap.panel.Content, {
64 * Returns the grid for this panel
65 * @return {Roo.bootstrap.Table}
71 setSize : function(width, height){
72 if(!this.ignoreResize(width, height)){
74 var size = this.adjustForComponents(width, height);
75 grid.getGridEl().setSize(size.width, size.height);
77 var thd = grid.getGridEl().select('thead',true).first();
78 var tbd = grid.getGridEl().select('tbody', true).first();
80 tbd.setSize(width, height - thd.getHeight());
89 beforeSlide : function(){
90 this.grid.getView().scroller.clip();
93 afterSlide : function(){
94 this.grid.getView().scroller.unclip();
100 Roo.bootstrap.panel.Grid.superclass.destroy.call(this);