I am using EXTJS and SERVLET, in servlet I am passing the value through request.setAttribute, But not able get the value in EXTJS.
Ext.onReady(function(){
var myData=null;
Ext.Ajax.request({
url: 'DisplayTest',
method:'POST',
success: function ( result, request ) {
myData =Ext.decode(result.responseText);
},
failure: function ( result, request) {
Ext.MessageBox.alert('Failed', result.responseText);
}
});
var store = new Ext.data.ArrayStore({
fields: [
{name: 'name'},
{name: 'id'},
]
});
store.loadData(myData);
// create the Grid
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{
// id :'company',
header : 'Name',
width : 160
},
{
header : 'ID',
width : 75
},
],
height: 350
});
grid.render('db-grid');
});
In above code I want to get the value from servlet into variable myData in the form of array or List. can anyone give me some example through servlet and EXTJS.
Thanks