johnr
13 Jun 2007, 6:33 AM
Hello everyone,
I've been wrestling with this issue for some time now, but still can't seem to figure it out.
Here's what I'm trying to do: First I grab a bunch of data off of testdata.xml and push it into my grid. That works fine, but later on, I'd like to have the user hit a button to append additional data into my grid from a separate xml file (testdata2.xml). I'm trying to get loadData to grab the new data from the new xml file for me, but I can't seem to get it to work properly.
function Table() {
this.account = Ext.data.Record.create([
{name: 'Selected', type: 'string'},
{name: 'Eri', type: 'string'},
{name: 'AcctNum', type: 'string'},
{name: 'AcctName', type: 'string'},
{name: 'Value', type: 'float'}
]);
this.ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'testdata.xml'}),
reader: new Ext.data.XmlReader({record: 'Item', id: 'AID'}, this.account)
});
this.ds.load();
// ...grid business
}
function addAccount() {
lt.ds.loadData(/*pass in testdata2.xml data*/, true);
}
Ext.onReady(
function() {
lt = new Table();
}
);
I'm pretty sure I'm just not sending the data object into loadData() in the correct format... I've looked all over the forums but can't seem fix this. Any help would be much appreciated!
I've been wrestling with this issue for some time now, but still can't seem to figure it out.
Here's what I'm trying to do: First I grab a bunch of data off of testdata.xml and push it into my grid. That works fine, but later on, I'd like to have the user hit a button to append additional data into my grid from a separate xml file (testdata2.xml). I'm trying to get loadData to grab the new data from the new xml file for me, but I can't seem to get it to work properly.
function Table() {
this.account = Ext.data.Record.create([
{name: 'Selected', type: 'string'},
{name: 'Eri', type: 'string'},
{name: 'AcctNum', type: 'string'},
{name: 'AcctName', type: 'string'},
{name: 'Value', type: 'float'}
]);
this.ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'testdata.xml'}),
reader: new Ext.data.XmlReader({record: 'Item', id: 'AID'}, this.account)
});
this.ds.load();
// ...grid business
}
function addAccount() {
lt.ds.loadData(/*pass in testdata2.xml data*/, true);
}
Ext.onReady(
function() {
lt = new Table();
}
);
I'm pretty sure I'm just not sending the data object into loadData() in the correct format... I've looked all over the forums but can't seem fix this. Any help would be much appreciated!