extjs4.0 如何将已获得的数据库里得值取出 求大神指点
varme=this;varMsgId=this.initparams;pp=MsgId;console.log(pp);//id,sendUser,sendDate,m...
var me=this;
var MsgId=this.initparams;
pp=MsgId;
console.log(pp);
//id,sendUser,sendDate,msgTitle,msgContent,msgHaveImg,msgHavePub,msgState
var myStore = Ext.create('Ext.data.Store', {
fields: [
{name: 'id', type: 'string'},
{name: 'sendUser', type: 'string'},
{name:'sendDate',type: 'string'},
{name: 'msgTitle', type: 'string'},
{name: 'msgContent', type: 'string'},
{name: 'msgHaveImg', type: 'string'},
{name: 'msgHavePub', type: 'string'},
{name: 'msgState', type: 'string'}
],
proxy: {
type: 'ajax',
url:'http://10.10.9.91:81/OAS/',
extraParams:{
pp:pp
},
reader: {
type: 'json',
root: 'data'
}
},
autoLoad: false
});
var title=me.query('displayfield[thisName="msgTitle"]')[0];
title.setValue("调出数据库的值"); 展开
var MsgId=this.initparams;
pp=MsgId;
console.log(pp);
//id,sendUser,sendDate,msgTitle,msgContent,msgHaveImg,msgHavePub,msgState
var myStore = Ext.create('Ext.data.Store', {
fields: [
{name: 'id', type: 'string'},
{name: 'sendUser', type: 'string'},
{name:'sendDate',type: 'string'},
{name: 'msgTitle', type: 'string'},
{name: 'msgContent', type: 'string'},
{name: 'msgHaveImg', type: 'string'},
{name: 'msgHavePub', type: 'string'},
{name: 'msgState', type: 'string'}
],
proxy: {
type: 'ajax',
url:'http://10.10.9.91:81/OAS/',
extraParams:{
pp:pp
},
reader: {
type: 'json',
root: 'data'
}
},
autoLoad: false
});
var title=me.query('displayfield[thisName="msgTitle"]')[0];
title.setValue("调出数据库的值"); 展开
1个回答
展开全部
用Ajax回调,你这样怎么取出来。
Ext.onReady(function () {
new Ext.Button({
renderTo: "div1",
text: "后台Ajax提交",
handler: function () {
Ext.Ajax.request({
url: 'Ajax_Func1',
headers: {
'userHeader': 'userMsg'
},
params: { a: 10, b: 20 },
method: 'GET',
success: function (response, options) {
Ext.MessageBox.alert('成功', '从服务端获取结果: ' + response.responseText);
},
failure: function (response, options) {
Ext.MessageBox.alert('失败', '请求超时或网络故障,错误编号:' + response.status);
}
});
},
id: "bt1"
});
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询