Non capisco il perchè in output non si visualizzano i dati.
Premetto che la visualizzazione dei dati avviaene in un oggetto grid e i dati vengono passati tramite json.
Ecco il codice:
var AsIsProdDataStore; // this will be our datastore
var AsIsProdColumnModel; // this will be our columnmodel
var AsIsProdListingEditorGrid;
var AsIsProdListingPanel;
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
Ext.QuickTips.init();
AsIsProdDataStore = new Ext.data.Store({
id: 'AsIsProdDataStore',
proxy: new Ext.data.HttpProxy({
url: 'indicatoriManager/indicatoriTecnologie/aggiornaInformazioniTable.jsp', // File to connect to
method: 'POST'
}),
baseParams:{task: "LISTING"}, // this parameter asks for listing
reader: new Ext.data.JsonReader({ // we tell the datastore where to get his data from
root: 'results',
totalProperty: 'total',
id: 'id'
},[
{name: 'Tipo', mapping: 'Tipo'},
{name: 'N. sistemi', mapping: 'N. sistemi'},
{name: 'Nome Tecnologia', mapping: 'Nome Tecnologia'}
]),
sortInfo:{field: 'Nome Tecnologia', direction: "ASC"}
});
AsIsProdColumnModel = new Ext.grid.ColumnModel(
[
{header: 'Tipo', dataIndex: 'Tipo', width: 120, readOnly: true},
{header: 'Nome Tecnologia', readOnly: true, dataIndex: 'Nome Tecnologia', width: 150}
]
);
AsIsProdColumnModel.defaultSortable= true;
AsIsProdListingEditorGrid = new Ext.grid.EditorGridPanel({
id: 'AsIsProdListingEditorGrid',
store: AsIsProdDataStore, // the datastore is defined here
cm: AsIsProdColumnModel, // the columnmodel is defined here
enableColLock:false,
loadMask: {msg: 'Caricamento...'},
tbar: [{
text: 'Export',
tooltip: 'Export in execel della tabella',
iconCls:'execelExtjs',
handler: function(){
exportXls();
}
}],
selModel: new Ext.grid.RowSelectionModel({singleSelect:false})
});
AsIsProdListingPanel = new Ext.Panel({
id: 'AsIsProdListingPanel',
closable:false,
resizable:false,
width:850,
height:287,
plain:true,
layout: 'fit',
items: AsIsProdListingEditorGrid // We'll just put the grid in for now...
});
AsIsProdDataStore.load(); // Load the data
AsIsProdListingPanel.render('contenitoreTableIndic atoreTecnologia');
});
dati in json:
[{"Tipo":"SW","N. sistemi":6,"Nome Tecnologia":".Net Framework"}, {"Tipo":"SW","N. sistemi":8,"Nome Tecnologia":"Accesso Remoto"}, {"Tipo":"SW","N. sistemi":2,"Nome Tecnologia":"Accesso Remoto - Client"}]
dove sbaglio?