extjs动态插入一列
2015-06-12 10:36
507 查看
StdDayWordQuery:function(btn,event){ var form=Ext.getCmp('queryFormSDW'); var userNameORuserCode = form.getForm().getValues()['userNameORuserCode']; var gradeCode = form.getForm().getValues()['gradeCode']; var startDate = form.getForm().getValues()['startDate']; var endDate = form.getForm().getValues()['endDate']; var params="gradeCode="+gradeCode+'&'; params+="userNameORuserCode="+userNameORuserCode+'&'; params+="startDate="+startDate+'&'; params+="endDate="+endDate; Ext.Ajax.request({ method : 'POST', url:'getDailyWordNum.action?'+params, async:false, success:function(response) { var ret=Ext.decode(response.responseText); // console.log(ret); if(ret.success){ //eval("var res=" + response.responseText); //var rows = res.rows; var rows=Ext.decode(response.responseText).rows; var cols = new Array(); var xx = new Array(); console.log(rows); console.log(rows[0]); for(var x in rows[0]){ //console.log(x); cols.push(new Ext.grid.column.Column({ text: x, dataIndex : x })); xx.push(x); } console.log(xx); var store = new Ext.data.Store({ fields: xx, data: rows }); var grid = Ext.getCmp('StudentDayWordGrid'); grid.reconfigure(store,cols); } else{ Ext.Msg.alert("错误", ret.msg); } } }); },
相关文章推荐
- 网页加载进度条中的javascript
- JavaScript中的toDateString()方法使用详解
- 推荐一款插件layim.js 阿里大牛贤心制作的一款webim聊天插件
- 201506120856_《JavaScript——客户端与服务器端的通信》
- IE6 IE7 不支持 JSON
- ExtJs 入门教程
- js中substr和substring两个方法的区别
- ExtJs 入门教程五[文本框:TextField]
- eval、json.parse()的介绍和使用注意点
- json和jsonp的联系和区别(转载)
- 在JavaScript中操作时间之setYear()方法的使用
- JavaScript 数字格式化函数
- js获取当前项目的根目录
- <转> Javascript的赋值是引用or复制,及参数传递
- Html下拉框Js对象属性方法总结
- 保留json字符串中文的函数,代替json_encode
- 简介JavaScript中setUTCSeconds()方法的使用
- JS中产生标识符方式的演变
- JS中处理时间之setUTCMinutes()方法的使用
- JS、JSP省市区切换