|
@@ -2,7 +2,7 @@
|
|
|
* js
|
|
|
*/
|
|
|
|
|
|
-var yjsbqdgrid_selector = "#yjsbqdTable";
|
|
|
+var yjsbqdGrid = "#yjsbqdGrid";
|
|
|
|
|
|
jQuery(function($) {
|
|
|
|
|
@@ -12,87 +12,42 @@ jQuery(function($) {
|
|
|
* 初始化Grid
|
|
|
*/
|
|
|
function initYjsbqdGrid() {
|
|
|
- // 数据表格初始化
|
|
|
- jQuery(yjsbqdgrid_selector).jqGrid({
|
|
|
- url : basePath + '/zyfzsq/list',
|
|
|
- mtype : "POST", //提交方式
|
|
|
- datatype : "json",
|
|
|
- autowidth: false,
|
|
|
- height :"auto",
|
|
|
- width: 828,
|
|
|
- shrinkToFit: true,
|
|
|
- sortname : "", //默认的排序列
|
|
|
- sortorder : "", //默认的排序列
|
|
|
- colNames : [ 'id','设施名称','数量','存放场所','操作'],
|
|
|
- colModel : [ {
|
|
|
- name : 'id',
|
|
|
- index : 'id',
|
|
|
- key : true,
|
|
|
- hidden:true,
|
|
|
- editable : false,
|
|
|
- sortable : false
|
|
|
- },{
|
|
|
- name : 'blbh',
|
|
|
- index : 'blbh',
|
|
|
- width:120,
|
|
|
- editable : false,
|
|
|
- sortable : false
|
|
|
- },{
|
|
|
- name : 'loginName',
|
|
|
- index : 'loginName',
|
|
|
- width:120,
|
|
|
- editable : false,
|
|
|
- sortable : false
|
|
|
- },{
|
|
|
- name : 'qymc',
|
|
|
- index : 'qymc',
|
|
|
- width:120,
|
|
|
- editable : false,
|
|
|
- sortable : false
|
|
|
- },{
|
|
|
- name : 'realName',
|
|
|
- index : 'realName',
|
|
|
- width:80,
|
|
|
- editable : false,
|
|
|
- sortable : false
|
|
|
- } ],
|
|
|
- rowNum : _rowNum, //每页显示记录数
|
|
|
- rowList : _rowList, //用于改变显示行数的下拉列表框的元素数组。
|
|
|
- page : 1, //设置初始的页码,初始为1
|
|
|
- rownumbers : true,
|
|
|
- pagerpos : 'center', //指定分页栏的位置
|
|
|
- altRows : true, //设置为交替行表格,默认为false
|
|
|
- multiselect : true, //可以多选
|
|
|
- multiboxonly : true, //只有选择checkbox才会起作用
|
|
|
- loadComplete : function() {
|
|
|
- var table = this;
|
|
|
- setTimeout(function() {
|
|
|
- updatePagerIcons(table);
|
|
|
- enableTooltips(table);
|
|
|
- }, 0);
|
|
|
- },
|
|
|
- prmNames : {
|
|
|
- oper : "oper",
|
|
|
- page : "page",
|
|
|
- rows : "rows",
|
|
|
- sort : "sidx",
|
|
|
- order : "sord"
|
|
|
- },
|
|
|
- postData :{
|
|
|
- condition1 : function(){ return ""; },//查询条件1
|
|
|
- condition2 : function(){ return ""; }//查询条件2
|
|
|
- },
|
|
|
- jsonReader : {
|
|
|
- root : "list", // json中代表实际模型数据的入口
|
|
|
- page : "page", // json中代表当前页码的数据
|
|
|
- total : "pages", // json中代表页码总数的数据
|
|
|
- records : "total", // json中代表数据行总数的数据
|
|
|
- repeatitems : false// 如果设为false,则jqGrid在解析json时,会根据name来搜索对应的数据元素
|
|
|
- },
|
|
|
- gridComplete: function () {
|
|
|
- comGridComplete("whxxTable", "editRecord");
|
|
|
- }
|
|
|
- });
|
|
|
- // 隐藏水平垂直滚动条
|
|
|
- jQuery(yjsbqdgrid_selector).closest(".ui-jqgrid-bdiv").css({ 'overflow-x' : 'hidden' ,'overflow-y':'hidden'});
|
|
|
+ //单列表简易渲染 设施名称','数量','存放场所','操作'
|
|
|
+ var table = $(yjsbqdGrid);
|
|
|
+ table.GM({
|
|
|
+ ajax_url: '',
|
|
|
+ ajax_type: 'POST'
|
|
|
+ ,totals:''// 如果该值不传,或者为无效的数字,将会无视supportAjaxPage的设定而默认为无分页
|
|
|
+ ,columnData: [{
|
|
|
+ key: 'qynbbh',
|
|
|
+ width: '120px',
|
|
|
+ align:'center',
|
|
|
+ text: '设施名称'
|
|
|
+ },{
|
|
|
+ key: 'wxhwm',
|
|
|
+ width: '140px',
|
|
|
+ align:'center',
|
|
|
+ text: '数量'
|
|
|
+ },{
|
|
|
+ key: 'wxhwm',
|
|
|
+ width: '140px',
|
|
|
+ text: '存放场所'
|
|
|
+ },{
|
|
|
+ key: 'id',
|
|
|
+ width: '80px',
|
|
|
+ text: '操作',
|
|
|
+ align:'center',
|
|
|
+ template: function(operation, rowObject){
|
|
|
+ //operation:当前key所对应的单条数据;rowObject:单个一行完整数据
|
|
|
+ return '<a class="operation" href="#" onclick="deleteWhxxRow(this)");>操作</a>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ,pagingBefore:function(query){}
|
|
|
+ ,pagingAfter: function(query){}
|
|
|
+ ,sortingBefore:function(query){}
|
|
|
+ ,sortingAfter: function(query){}
|
|
|
+ ,ajax_beforeSend: function(query){}
|
|
|
+ ,ajax_complete: function(data){}
|
|
|
+ },function(query){});
|
|
|
};
|