PDA

View Full Version : no one answer



jackoff
3 Sep 2010, 5:29 AM
hi

im a new user of ExtJs in past i wrote 3 thread before this and i didnt have any answere. luckly ive resolved the issue but i waste much much time.
now i have another problem and i hope that someone here can help me coz really i dont know why it doesnt work.

i can't populate my gridpanel with dwr.
the calling of dwr class works and it retrive the data from the db but i dont know why my gridpanel is always blank.

this is my code of js file


Ext.onReady(function(){

Ext.BLANK_IMAGE_URL = '/scripts/ext/resources/images/default/s.gif';

var cmGrid = new Ext.grid.ColumnModel( [
{
header : 'idTicket', //getJsResource('panel.ticket'),
width : 50,
fixed : true,
dataIndex : 'idTicket',
align : 'center',
hideable : false
},
{
header : 'stato',//getJsResource('panel.criticita'),
width : 50,
fixed : true,
dataIndex : 'stato',
align : 'center',
hideable : false
}

]);

cmGrid.defaultSortable = true;

/*-----------FINE COLUMN MODEL PER LA GRID--------*/


var dsGrid = new Ext.data.Store({
proxy : new Ext.data.DWRProxy(true, DWRTicket.getElencoTicket, [ 'unita'
, 'dataInizio'
, 'dataFine'
, 'stato'
])
,listeners : {'beforeload': function(dataProxy, params)
{
params.unita = 'DP6NU6';
params.dataInizio = '01/01/2010';
params.dataFine = '03/09/2010';
params.stato = 'AP';
}

}
,reader : new Ext.data.ListRangeReader( {id:'idTicket', totalProperty: 'totalSize'}, cmGrid)
,remoteSort: true
,baseParams: {limit: 100}
});

dsGrid.load({

params : {
unita : 'DP6NU6'
,dataInzio: '01/01/2010'
,dataFine: '03/09/2010'
,stato: 'AP'
}
});

var grid = new Ext.grid.GridPanel({
id : 'panelGrid'
,store : dsGrid
,cm : cmGrid
,loadMask : true
,stripeRows : true
,height : '100%'
,layout : 'fit'
,bbar: new Ext.PagingToolbar({
pageSize: dsGrid.baseParams.limit,
store: dsGrid,
displayInfo: true,
displayMsg: 'risultati trovati {0} - {1} di {2}',
emptyMsg: "nessun risultato trovato"
})
,autoExpandMin : 100
,viewConfig : { forceFit: true
, frame : true
}
});
grid.store.load({
params: ({
purge: true
,start: 0
})
});
grid.render('treeUnita');
});

this is the dwr method that retrive the data


public ListRange<TicketAT> getElencoTicket(String unita,String dataInizio,String dataFine,String stato)
{
System.out.println("SONO DENTRO");

List<TicketAT> t = new DaoTicket().getListaTicketByUnita(unita, dataInizio, dataFine, stato);
int i;
for( i=0; i < t.size(); i++)
{
System.out.println("idTicket: " + t.get(i).getIdTicket() + " Stato: " + t.get(i).getStato());
}

System.out.println("i: " + i);
return new ListRange<TicketAT>(t);
}


any one can tell me why the gridpanel is always blank?
thank you so much

Condor
3 Sep 2010, 6:10 AM
Start debugging.
- Is the request sent?
- Is the response received?
- Does the store load event fire?
- Does the store loadexception event fire?

jackoff
3 Sep 2010, 6:40 AM
thanks for your answer


proxy : new Ext.data.DWRProxy(true, DWRTicket.getElencoTicket, [ 'unita'
, 'dataInizio'
, 'dataFine'
, 'stato'
])

putting false instead of true on the grid panel appears only one record.
now im going to debugging.

jackoff
3 Sep 2010, 6:40 AM
thanks for your answer


proxy : new Ext.data.DWRProxy(true, DWRTicket.getElencoTicket, [ 'unita'
, 'dataInizio'
, 'dataFine'
, 'stato'
])

putting false instead of true on the grid panel appears only one record.
now im going to debugging.