amegahed
30 Jun 2009, 1:22 PM
I have a few questions regarding the Desktop apps:
1. I followed the example in the dist. to make two forms that read from MySQL tables and fill in a grid. I tried to divide the code so i could read it better so i created my grid as follows:
var seriesGP = new Ext.grid.GridPanel({
border:false,
region: 'center',
store: store,
columns: [
sm,
{id:'seriesid',header: "ID", width: 30, sortable: true, hidden: true, dataIndex: 'seriesid'},
{header: 'Name', width: 470, sortable: true, dataIndex: 'seriesname'}
],
sm: sm,
stripeRows: true,
bbar: pagingBar
});
and in the page constructor i declared it as follows:
MyDesktop.MySeriesWindow = Ext.extend(Ext.app.Module, {
id:'myseries-win',
init : function(){
this.launcher = {
text: 'My Series',
iconCls:'icon-movie',
handler : this.createWindow,
scope: this
}
},
createWindow : function(){
var desktop = this.app.getDesktop();
var winS = desktop.getWindow('myseries-win');
if(!winS){
winS = desktop.createWindow({
id: 'myseries-win',
title:'My Series',
width:740,
height:480,
iconCls: 'icon-movie',
shim:false,
animCollapse:false,
constrainHeader:true,
layout: 'border',
items: [ seriesGP, seriesP]
});
}
winS.show();
}
});
the code loads with no problem the first time i open the page, but if i close it, and then open it again, the page opens up blank, both the grid (and the panel) are not displayed, but if put the code like this:
MyDesktop.MySeriesWindow = Ext.extend(Ext.app.Module, {
.....
items: [
new Ext.grid.GridPanel({
border:false,
region: 'center',
store: store,
columns: [
sm,
{id:'seriesid',header: "ID", width: 30, sortable: true, hidden: true, dataIndex: 'seriesid'},
{header: 'Name', width: 470, sortable: true, dataIndex: 'seriesname'}
],
sm: sm,
stripeRows: true,
bbar: pagingBar
}),
//seriesGP,
seriesP]
then the grid will load every time i open the page (but the panel [seriesP] does not).
Im not very good with Java, so, i would appreciate it if anyone's help should take that into account.
1. I followed the example in the dist. to make two forms that read from MySQL tables and fill in a grid. I tried to divide the code so i could read it better so i created my grid as follows:
var seriesGP = new Ext.grid.GridPanel({
border:false,
region: 'center',
store: store,
columns: [
sm,
{id:'seriesid',header: "ID", width: 30, sortable: true, hidden: true, dataIndex: 'seriesid'},
{header: 'Name', width: 470, sortable: true, dataIndex: 'seriesname'}
],
sm: sm,
stripeRows: true,
bbar: pagingBar
});
and in the page constructor i declared it as follows:
MyDesktop.MySeriesWindow = Ext.extend(Ext.app.Module, {
id:'myseries-win',
init : function(){
this.launcher = {
text: 'My Series',
iconCls:'icon-movie',
handler : this.createWindow,
scope: this
}
},
createWindow : function(){
var desktop = this.app.getDesktop();
var winS = desktop.getWindow('myseries-win');
if(!winS){
winS = desktop.createWindow({
id: 'myseries-win',
title:'My Series',
width:740,
height:480,
iconCls: 'icon-movie',
shim:false,
animCollapse:false,
constrainHeader:true,
layout: 'border',
items: [ seriesGP, seriesP]
});
}
winS.show();
}
});
the code loads with no problem the first time i open the page, but if i close it, and then open it again, the page opens up blank, both the grid (and the panel) are not displayed, but if put the code like this:
MyDesktop.MySeriesWindow = Ext.extend(Ext.app.Module, {
.....
items: [
new Ext.grid.GridPanel({
border:false,
region: 'center',
store: store,
columns: [
sm,
{id:'seriesid',header: "ID", width: 30, sortable: true, hidden: true, dataIndex: 'seriesid'},
{header: 'Name', width: 470, sortable: true, dataIndex: 'seriesname'}
],
sm: sm,
stripeRows: true,
bbar: pagingBar
}),
//seriesGP,
seriesP]
then the grid will load every time i open the page (but the panel [seriesP] does not).
Im not very good with Java, so, i would appreciate it if anyone's help should take that into account.