PDA

View Full Version : form and grid on the same page



raj_plays
28 Jan 2010, 10:22 PM
Hi,
I need to make a page that has a form that takes input parameters and submits to a web service. This web service gets the data based on those parameters and sends an XML back to the page. This XML data needs to be shown in a gridpanel below the form.

My question is how to retireve the xml data after a successful form submit.
I have always used a store as below:

var quuwordDataStore = new Ext.data.Store({

proxy: new Ext.data.HttpProxy({url: 'Service.asmx/get', method: 'POST'}),
baseParams: {campaign_id: campaign_id},
reader: new Ext.data.XmlReader({
record: 'Table',
idProperty: 'id'
},Quuword),
sortInfo:{field: 'name', direction: "ASC"}
});

but here the url is the same as the form submit url

My form is given below.....

var panel = new Ext.Panel ({
labelWidth: 75,
url:'ReportService.asmx/get' (http://www.extjs.com/forum/'ReportService.asmx/get'),
frame:true,
title: 'Report',
bodyStyle:'padding:5px 5px 0',
width: 300,
defaults: {width: 100},
defaultType: 'textfield',
layout: 'form',
items: [{
fieldLabel: 'Keyword',
name: 'keyword',
allowBlank:false
}],


buttons: [{
text: 'Save',
handler: function () {
// when this button clicked, submit this form
panel.getForm().submit({
waitMsg: 'Saving...', // Wait Message
success: function () { // When saving data success
Ext.MessageBox.alert ('Message','Data has been saved');

//showGrid();
},
failure: function () { // when saving data failed
Ext.MessageBox.alert ('Message','Saving data failed');
}
});
}
}
}]

});

Please advise what to put in the showGrid() function....just the loading to store part.