请问我通过在做extjs时用json后台获取了一个数据,用store.on函数得到赋值给变量,但是怎么在函数外面得到
最佳回答
最新回答共有2条回答
-
2026-03-30 08:58:52鲤鱼世界
回复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:1028 });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。jsonstcCallback1009(,]});
热门文章
- 康达学院专转本五年制
- 高考一个考场分ab卷吗
- not only but also用法
- 某物体做自由落体运动,从释放开始计时,则物体在前2s内的平均速度为______m/s,物体下落2m时的速度大小为______m/s.
- 三角函数公式大全表格
- 地理中考必背知识点2022
- 2013-2014学年小学六年级科学上学期期末考试试卷及答案
- 人教版2014-2015学年小学五年级英语第二学期期中教学质量检测试卷及答案
- 【Linux驱动开发】设备树详解(二)设备树语法详解
- 别跟客户扯细节
- 在别的城市买房子能落户吗
- 卖房前要把装修贷还完吗
- 高中政治教学提高教学效果的方法探究
- “互联网+”背景下的初中英语课堂教学改革与创新策略研究
- 2022年终止合同范本
- 租房合同范本范文
- 如何挑选土豆
- 如何挑选土鸡
