2、JavaScript
;(function($){
$.fn.jqGridTypeDefine = function(options){
//获取jquery对象
var grid_selector = this;
var initDate = “{oper: “”,” +
“height: “”,” +
“width: “”,” +
"pager_selector: "typeDefinePag
《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》
【docs.qq.com/doc/DSmxTbFJ1cmN1R2dB】 完整内容开源分享
er"," +
“where: “”,” +
“wherestring: {},” +
“fileds: [“id”, “property”, “name”, “sensortype”, “unit”,“highvalue”],” +
“table:“kj_typedefine”}”;
$.ajax({
url:“MyServlet”,
async:true, //是否为异步请求
cache:false, //是否缓存结果
type:“GET”,
dataType:“json”,
data :{
“data” : initDate,
},
success : function(data){
for(var i=0;i<=data.length;i++){
$("#typeDefine").jqGrid(‘addRowData’,i+1,data[i]);
}
}
})
switch(options.oper){
case ‘jqGridCre’:jqgridCre(initDate,grid_selector);
break;
case ‘jqGridFre’:jqGridFre(initDate,grid_selector);
break;
}
$(’[id^=jqgh_typeDefine_]’).css(“height”,“20px”)