请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/09/28 13:21:57
请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到
store.on('load',function(){
animals = store.getAt(0).get('animals');
alert(aa);
}) ;
store.load();
怎么得到animals的值在函数外面?先谢谢大哥哥大姐姐了.
还有能写个例子最好.设置个全局变量行吗?能举个例子吗?我对这个callback不怎么熟悉.我试了一下还是不行,能举个例子吗?可能是我的理解错误.呵呵
store.on('load',function(){
animals = store.getAt(0).get('animals');
alert(aa);
}) ;
store.load();
怎么得到animals的值在函数外面?先谢谢大哥哥大姐姐了.
还有能写个例子最好.设置个全局变量行吗?能举个例子吗?我对这个callback不怎么熟悉.我试了一下还是不行,能举个例子吗?可能是我的理解错误.呵呵
1 var ds = new Ext.data.Store({
2 proxy: new Ext.data.ScriptTagProxy({
3 url: 'yoururl.json'
4 }),
5 reader: new Ext.data.JsonReader({
6 root: 'Fields',
7 totalProperty: 'totalCount',
8 id: 'id'
9 }, [
10 ,
11
12 ])
13 });
14 var combobox = new Ext.form.ComboBox({
15 id:'combobox',
16 x:0,
17 y:20,
18 store: da,
19 displayField:'field',
20 typeAhead: false,
21 loadingText: '正在加载字段...',
22 forceSelection: false,
23 triggerAction: 'all',
24 hideTrigger:false,
25 minChars:1,
26 anchor: '100%',
27 pageSize:10
28 });
json输出
注意stcCallback1007要用程序输出请求过来的参数callback的值
stcCallback1007(,]});stcCallback1007(,]});stcCallback1007(,]});
不好意思,看错了,以下是grid的
// create the Data Store
var singleTablestore = new Ext.data.JsonStore({
root: 'topics',
totalProperty: 'totalCount',
idProperty: 'tableid',
remoteSort: true,
fields: [
,'name','description','importdate'
],
// load using script tags for cross domain, if the data in on the same domain as
proxy: new Ext.data.ScriptTagProxy({
url: 'abc.json'
})
});
singleTablestore.setDefaultSort('date', 'desc');
var singleTable = new Ext.grid.EditorGridPanel({
id:'singleTable-panel',
layout:'anchor',
anchor:['100%','100%'],
title:'单表数据处理',
store: singleTablestore,
//trackMouseOver:false,
//disableSelection:true,
loadMask: true,
autoScroll:true,
// grid columns
columns:[{
id: 'name',
header: "数据表名称",
dataIndex: 'name',
width: 200,
sortable: true,
renderer:renderTips
},{
id: 'description', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b )
header: "数据表描述",
dataIndex: 'description',
renderer:renderTips2,
editor:new Ext.form.TextField(),
width: 270,
// renderer: renderTopic,
sortable: true
},{
header: "导入日期",
dataIndex: 'importdate',
width: 150,
sortable: true
},{
id: 'tableid',
header: "操作",
dataIndex: 'tableid',
width: 450,
resizable: false,
//editor:new Ext.Button()
renderer: renderLast
//items:[new Ext.Button()]
}],
// customize view config
viewConfig: {
//forceFit:true,
enableRowBody:true,
//showPreview:true
},
// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 20,
store: singleTablestore,
displayInfo: true,
displayMsg: '当前显示 - 条,共 条',
beforePageText:'第',
afterPageText:'页,共页',
emptyMsg: "没有相应内容",
items:[
'-', {
pressed: true,
enableToggle:true,
text: 'Show Preview',
cls: 'x-btn-text-icon details',
toggleHandler: function(btn, pressed){
...
}
}]
})
});
singleTable.on('afteredit', afterEdit, this );
singleTable.on('show', function()});}, this );
function afterEdit(e) {
...
}
abc.json
stcCallback1009(,]});
2 proxy: new Ext.data.ScriptTagProxy({
3 url: 'yoururl.json'
4 }),
5 reader: new Ext.data.JsonReader({
6 root: 'Fields',
7 totalProperty: 'totalCount',
8 id: 'id'
9 }, [
10 ,
11
12 ])
13 });
14 var combobox = new Ext.form.ComboBox({
15 id:'combobox',
16 x:0,
17 y:20,
18 store: da,
19 displayField:'field',
20 typeAhead: false,
21 loadingText: '正在加载字段...',
22 forceSelection: false,
23 triggerAction: 'all',
24 hideTrigger:false,
25 minChars:1,
26 anchor: '100%',
27 pageSize:10
28 });
json输出
注意stcCallback1007要用程序输出请求过来的参数callback的值
stcCallback1007(,]});stcCallback1007(,]});stcCallback1007(,]});
不好意思,看错了,以下是grid的
// create the Data Store
var singleTablestore = new Ext.data.JsonStore({
root: 'topics',
totalProperty: 'totalCount',
idProperty: 'tableid',
remoteSort: true,
fields: [
,'name','description','importdate'
],
// load using script tags for cross domain, if the data in on the same domain as
proxy: new Ext.data.ScriptTagProxy({
url: 'abc.json'
})
});
singleTablestore.setDefaultSort('date', 'desc');
var singleTable = new Ext.grid.EditorGridPanel({
id:'singleTable-panel',
layout:'anchor',
anchor:['100%','100%'],
title:'单表数据处理',
store: singleTablestore,
//trackMouseOver:false,
//disableSelection:true,
loadMask: true,
autoScroll:true,
// grid columns
columns:[{
id: 'name',
header: "数据表名称",
dataIndex: 'name',
width: 200,
sortable: true,
renderer:renderTips
},{
id: 'description', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b )
header: "数据表描述",
dataIndex: 'description',
renderer:renderTips2,
editor:new Ext.form.TextField(),
width: 270,
// renderer: renderTopic,
sortable: true
},{
header: "导入日期",
dataIndex: 'importdate',
width: 150,
sortable: true
},{
id: 'tableid',
header: "操作",
dataIndex: 'tableid',
width: 450,
resizable: false,
//editor:new Ext.Button()
renderer: renderLast
//items:[new Ext.Button()]
}],
// customize view config
viewConfig: {
//forceFit:true,
enableRowBody:true,
//showPreview:true
},
// paging bar on the bottom
bbar: new Ext.PagingToolbar({
pageSize: 20,
store: singleTablestore,
displayInfo: true,
displayMsg: '当前显示 - 条,共 条',
beforePageText:'第',
afterPageText:'页,共页',
emptyMsg: "没有相应内容",
items:[
'-', {
pressed: true,
enableToggle:true,
text: 'Show Preview',
cls: 'x-btn-text-icon details',
toggleHandler: function(btn, pressed){
...
}
}]
})
});
singleTable.on('afteredit', afterEdit, this );
singleTable.on('show', function()});}, this );
function afterEdit(e) {
...
}
abc.json
stcCallback1009(,]});
请问,我在VB里自己定义了一个函数,函数的输入变量为一个,函数计算结果为三个输出变量,请问怎么返回函数值
python,定义一个函数A,函数B有一个变量,函数调用时怎么在函数A里获取变量的值.可以用数据库是什么的
请问C#中我在一个panel控件中添加了ABCD四个按钮,后台代码怎么获取这个panel的值,panel.items.
请问matlab 如何对一个函数求积分同时又能给函数变量赋值?
请问,我在matlab获取了轮廓坐标,怎样将X坐标付值给一个变量,Y坐标付值给一个变量.
在matlab里怎么给函数求导后赋值
先定义了一个变量i,然后在函数a里面对它进行了赋值,现在我想在函数b里面调用所赋的值,该怎么写啊?
C#中能得到随机数的函数是什么啊,怎么才能将随机输出的随机数赋给一个变量?
我定义了一个函数max(),我在这个函数里面在定义一个max变量,
matlab怎么调用function函数给变量赋值计算如下函数
在C语言赋值语句中,给多个变量赋值,用逗号隔开,岂不是相当于一个逗号表达式?
matlab的子函数中涉及一个变量,在主函数中会进行赋值,在子函数中怎样定义