PDA

View Full Version : window with grid



petcy
11 Oct 2010, 4:27 AM
i want to create a window with a grid pannel in it...how???

Animal
11 Oct 2010, 4:27 AM
Come on!

layout: 'fit',
items: grid

petcy
11 Oct 2010, 4:32 AM
yaaaaaaa
thats i've already given..

{
text:'View',
handler: function(btn){
var wi = new Ext.Window({
title: 'Language View Details',
width: 300,
height: 200,
layout:fit,
closable: true,
id:'one2many-win',
items:grid,
showAnimDuration: 5 // 2 sec is really slow
});
wi.show(btn.getEl());
},
renderTo: Ext.getBody()

}


i wanna load a grid to this window....

petcy
11 Oct 2010, 4:35 AM
again...

my grid panel is very simple..



var grid = new Ext.grid.GridPanel({



width:405,
height:300,
title:'Adventure Works Products',
store: store,
stripeRows: true,
loadMask: true,
enableHdMenu: false,
// grid columns
columns:[{
header: "id",
id: 'ProductID',
dataIndex: 'ProductID',
hidden:true
},{
header: "Product Name",
dataIndex: 'Name',
width: 200
}],
// put paging bar on the bottom
});

Condor
11 Oct 2010, 4:39 AM
OK, so what is the problem?

(apart from the fact that you should be reusing your window - currently it will fail the second time you click the button)

petcy
11 Oct 2010, 4:42 AM
yes Condor..
i've the same prblm... how can i solve.???(button second click..)

and i've another prblm is that i cannot load grid to my window...how???

Animal
11 Oct 2010, 4:44 AM
closeAction config

Other problem? "cannot load grid to my window" is not a valid problem description.

petcy
11 Oct 2010, 4:47 AM
i couldn't get u Animal...

Animal
11 Oct 2010, 4:47 AM
Window API docs.

closeAction

psmacarov
11 Oct 2010, 4:54 AM
May be it help u


var grid = new Ext.grid.GridPanel({
border: false,
renderTo: document.body,
id: 'info_grid_otk2',
frame:true,
height:500,
width:800,
plugins: summary,
store: mids,
columns: columns,
collapsible: true,
animCollapse: false,

view: new Ext.grid.GroupingView({
groupTextTpl: '{text}'
})

});


var w = new Ext.Window({
height: 540, width: 820,
title: '????????? ??????????',
listeners: {
close: {
fn: function(){
mids.removeAll();
}
}
},
items: grid
});
w.show();

petcy
11 Oct 2010, 4:56 AM
i set closeAction:'hide'
still i've the same prblm....

pls help me with a bit of code...

Condor
11 Oct 2010, 4:59 AM
You say you want to put a grid in a window and you post code that should (partially) work. So what EXACTLY is the problem?