请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到store.on('load',function(){animals = store.getAt(0).get('animals');alert(aa);}) ;store.load();怎么得到animals

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/08 05:37:23
请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到store.on('load',function(){animals = store.getAt(0).get('animals');alert(aa);}) ;store.load();怎么得到animals

请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到store.on('load',function(){animals = store.getAt(0).get('animals');alert(aa);}) ;store.load();怎么得到animals
请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到
store.on('load',function(){
animals = store.getAt(0).get('animals');
alert(aa);
}) ;
store.load();
怎么得到animals的值在函数外面?先谢谢大哥哥大姐姐了.
还有能写个例子最好.设置个全局变量行吗?能举个例子吗?我对这个callback不怎么熟悉.我试了一下还是不行,能举个例子吗?可能是我的理解错误.呵呵

请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到store.on('load',function(){animals = store.getAt(0).get('animals');alert(aa);}) ;store.load();怎么得到animals
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(,]});

请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到store.on('load',function(){animals = store.getAt(0).get('animals');alert(aa);}) ;store.load();怎么得到animals json是什么json能用在桌面程序中吗 刚才你回答了关于JSON-LIB关于过滤关联的集合属性,我想请问,我那段代码是放在Action控制器中吗?还是放在别处,我在做查询一个表(有主外键关系)的时候,因为Hibernate框架的原因,出现关连 请问JSON怎么存放公共元素,类似{firstname:John,lastname:[Bob,Smith]},我希望firstname公共 请问C#中我在一个panel控件中添加了ABCD四个按钮,后台代码怎么获取这个panel的值,panel.items. JSON = JSON || extJs树结构展开问题?现在在用Ext做一个项目,用的Ext 的树控件,我的这个tree最多有5层,现在如果我用tree.expandAll()的话,这个树会全部展开,但是我不想让它全部展开,全部展开太长了,我想只展开 5130 破权要把手机连电脑吗?具体怎么操做?我不要链接!说步骤(后台挂Q) 按键精灵9,我要一个按键精灵脚本 就是在后台2秒按一次A的的脚本 什么是JSON json是什么意思? 什么是JSON 微信后台统计数据不准,是怎么回事?据说微信后台统计数据中,“原文页阅读人数”是点击文章末尾“阅读原文”的人数.我都没有在文章末尾添加原文链接,怎么会出现“阅读原文”呢?那些人 SAP系统在做自动PR转PO的时候,系统是根据什么条件去判断使用哪种PO TYPE,例如:我在后台配置了NA,NB,NC,ND四种PO的documengt type,每种都可以链接到PR的TYPE document type NB,这样在我做一个NB的PR之后,使 在extjs中,验证结束时间大于开始时间并小于当前时间? 汉译英词组建议某人做某事 拒绝做某事 告诉某人关于某事 我们中的一个 舞曲 在...结束时 在...前面 宁愿是你而不是我 在后台 最好的乐手 独奏 提醒某人关于某事 太遗憾了 以.为骄傲 把某 谁会做按键精灵的脚本,我需要从A点移动到B点,同时按1键.反复循环,支持后台 Extjs listeners用法