初学extjs,
后台ProcessQuery.ashx:
string xmlString = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<NewDataSet>\n" +
"<Table>\n" +
"<a>1</a>\n" +
"<b>2</b>\n" +
"<c>3</c>\n" +
"<d>4</d>\n" +
"<e>5</e>\n" +
"<f>6</f>\n" +
"<g>7</g>\n" +
"<h>8</h>\n" +
"</Table>\n" +
"</NewDataSet>";
context.Response.ContentType = "Application/xml";
context.Response.Write(xmlString);前台:
Ext.onReady(function() {
var dsCust = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({ url: 'PeocessQuery.ashx'}),
reader: new Ext.data.XmlReader({
record: "Table",
},
['a', 'b', 'c', d', 'e', 'f', 'g', 'h'])
});
dsCust.load();
dsCust.on('load', function() { alert(123); })
alert(dsCust.getCount());
})
测试时alert不弹出123, 只弹出0,请问哪块出了问题。
后台ProcessQuery.ashx:
string xmlString = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<NewDataSet>\n" +
"<Table>\n" +
"<a>1</a>\n" +
"<b>2</b>\n" +
"<c>3</c>\n" +
"<d>4</d>\n" +
"<e>5</e>\n" +
"<f>6</f>\n" +
"<g>7</g>\n" +
"<h>8</h>\n" +
"</Table>\n" +
"</NewDataSet>";
context.Response.ContentType = "Application/xml";
context.Response.Write(xmlString);前台:
Ext.onReady(function() {
var dsCust = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({ url: 'PeocessQuery.ashx'}),
reader: new Ext.data.XmlReader({
record: "Table",
},
['a', 'b', 'c', d', 'e', 'f', 'g', 'h'])
});
dsCust.load();
dsCust.on('load', function() { alert(123); })
alert(dsCust.getCount());
})
测试时alert不弹出123, 只弹出0,请问哪块出了问题。
var dsCust = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({ url: 'PeocessQuery.ashx'}),
reader: new Ext.data.XmlReader({
record: "Table"
},
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'])
});
dsCust.load();
dsCust.on('load', function() { alert(123); })
alert(dsCust.getCount());
})
proxy: new Ext.data.HttpProxy({ url: 'ProcessQuery.ashx'}), //这里
reader: new Ext.data.XmlReader({
record: "Table" //,
},
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'])
});
dsCust.load();
dsCust.on('load', function() { alert(123); })
alert(dsCust.getCount());