cannot read property 'options' of underfined
在easyui中初始化 加载加datagrid就好了。如下,
<script>
$(function(){initDatagrid(); //初始化四种形态initDatagrid2();//已提交保送信息window.setTimeout(function(){loadDatagrid(); //加载待确认},100);//延迟100毫秒执行,避免请求提交两次的问题$(".datagrid-body").css("overflow-x","hidden");//显示横向滚动条
});
</script>
//init
function initDatagrid(){//表格var columnArr =[{field:'ck',title:'选择',width:5,halign:'center',align:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,20]",editable:false }},formatter : function(value,row,index){return '<input type="radio" onclick="sel('+row.f4NotifiedId+')" name="f4NotifiedId" value="'+row.f4NotifiedId+'" />';}}, {field:'workYear',title:'年',width:10,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}}},{field:'reason',title:'季度',width:10,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}}},{field:'createUser',title:'创建者',width:10,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}}},{field:'templateFileName',title:'模板名称',width:10,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}}},{field:'createTime',title:'创建时间',width:10,halign:'center', editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}},formatter: function(value,row,index){if(!value){return "";}var dateValue = new Date(value);return dateFormat(dateValue, dateFormat.masks.isoDate);}},{field:'endDate',title:'反馈截止时间',width:10,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}}},{field:'status',title:'下发状态',width:10,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}},formatter : function(value,row,index){if(value=='0'){return '<span style="color:green">未下发</span>'}else if(value == '1'){return '已下发';}else if(value == '2'){return '已结束';}}},{field:'_operate',title:'操作',width:20,halign:'center',editor:{type:'validatebox',options:{required:true,validType:"length[1,100]"}},formatter: function(value,row,index){var $tHtml = '';$tHtml = $tHtml + '<input type="button" class="" name="button1" onclick="send('+row.f4NotifiedId+');" value="下发"/>';$tHtml = $tHtml + '<input type="button" class="" name="button1" onclick="update('+row.f4NotifiedId+');" value="修改"/>';$tHtml = $tHtml + '<input type="button" class="" name="button1" onclick="del('+row.f4NotifiedId+');" value="删除"/>';return $tHtml;}}];$('#dataTable').datagrid({fitColumns : true, //列适应表格宽度striped : true, //设置为true将交替显示行背景。nowrap : false, //设置为true,当数据长度超出列宽时将会自动截取rownumbers : true,singleSelect : true,selectOnCheck : false,checkOnSelect:false,pagination : true, //添加分页栏pageSize : 10, //每页显示多少条?pageList : [5,10,20,30,50],sortOrder : 'desc',idField:'id',scrollbarSize :0,columns:[columnArr]});
}//load
function loadDatagrid(){var queryParams={};// ---- table loadvar options = $('#dataTable').datagrid('options');options.url = '${pageContext.request.contextPath}/s/manage/f4/****/list';options.queryParams = queryParams;$('#dataTable').datagrid(options);
}
在下面方法中,
//load
function loadDatagrid(){var queryParams={};var options = $('#dataTable').datagrid('options');options.url = '${pageContext.request.contextPath}/s/manage/f4/****/list';options.queryParams = queryParams;$('#dataTable').datagrid(options);
}
控制台提示的 var options = $('#dataTable').datagrid('options'); 这一行有问题。查询代码发现在就绪函数中我没有初始化initDatagrid2(),所以提示的没有定义。加上就好了,记录一下
cannot read property 'options' of underfined相关推荐
- JsTree中提示:Cannot read property 'core' of underfined
场景 Jstree的树形结构正好好运行,给数据添加了禁用状态后,就提示: 在仔细比对代码没错订单情况下,猜测是数据原因. 实现 因为添加了是否禁用状态,首次进入页面时默认加载启用的数据,但是启用的数据 ...
- 使用element ui + vue时出现vue.runtime.esm.js:1737 TypeError: Cannot read property ‘$options‘ of undefined
原因是</el-form-item>标签未在</el-form>标签范围内
- jQuery异步上传文件
jQuery异步上传文件 我想通过jQuery异步上传文件,这是我的HTML: 1 2 3 <span>File</span> <input type="fil ...
- 多年iOS开发经验总结(一)
为什么80%的码农都做不了架构师?>>> http://www.jianshu.com/p/1ff9e44ccc78 总结了几个月的东西终于能和大家分享了,不多说,直接看东西! ...
- MyBatis的一对和多对对和动态SQL
一对多关联: MyBatis中使用collection标签来解决一对一的关联查询, collection标签可用的属性如下:property:指的是集合属性的值ofType:指的是集合中元素的类型co ...
- Android必知必会-Android Studio下配置和使用Lambda
什么是Lambda表达式 lambda表达式,它将允许我们将行为传到函数里.在Java 8之前,如果想将行为传入函数,仅有的选择就是匿名类,需要6行代码.而定义行为最重要的那行代码,却混在中间不够突出 ...
- Vue.js 插件开发详解
前言 随着 Vue.js 越来越火,Vue.js 的相关插件也在不断的被贡献出来,数不胜数.比如官方推荐的 vue-router.vuex 等,都是非常优秀的插件.但是我们更多的人还只停留在使用的阶段 ...
- mac中安装activeMQ
一贯地,使用brew来帮忙.现在brew中添加了activeMQ了. 执行: brew install activemq OK. 看看是否安装成功,输入命令: activemq INFO: Loadi ...
- sketch放入app组件_使用Sketch App设计CSS网格
sketch放入app组件 首先定义您的网格 (Start by defining your grid) Sketch has 2 built-in layout features - Layout ...
- json模拟数据怎么用_在使用axios获取自己模拟的json数据是踩到的坑
最近在使用Vue仿写一个网易云音乐的单页面应用,当页面布局什么的写完后,然后就准备用axios获取后台数据渲染页面了,当然,我自己写的,并没有后台,所以,我就自己写json文件,然后弄proxy代理什 ...
最新文章
- bmaplib vue 调用_Vue-cli3/4中使用AMap、BMap
- 【转载】如何使用STM32的窗口看门狗
- Zigbee协议栈中OSAL的运行机理
- 苹果紧急修复三枚已遭在野利用的 iOS 0day
- Citrix XVA文件格式
- 多媒体台式计算机安装方法,台式机如何组装 台式机组装注意事项【详解】
- VSCode中使用Git忽略提交代码设置
- 判断请求是通过点击链接还是直接输入网址
- 本地html导入印象笔记,LocalNote,让你像使用本地文件一样使用印象笔记(支持 markdown 格式)...
- MacBook Pro 2017版A1708 更换ssd
- extjs6整合到web项目中
- 激光共聚焦如何选择荧光染料
- 蒟蒻的做题录(时间)
- 台式机插上耳机没有声音
- 【STC15单片机】动态数码管
- 手机损坏的视频怎么修复
- vue解决Element-ui中 el-cascader 级联选择器 最后一级数据为空显示暂无数据问题
- Frammer X for Mac(视频截图软件)
- ACL2020论文阅读笔记:BART
- echarts 中国地图标注所在点