function detail(id) {
$(".buttonShow").hide();
$("#tiJiao").hide();
flag1 = "查看";
var editRow = undefined; //定义全局变量:当前编辑的行
var beforeRow;
$("#ThisAdd").dialog("open").dialog("setTitle", "自定义问题类型查看");
$.ajax({
type: "post",
data: {fId: id},
url: "${BASE_FRONT}/specialcheckdef/setData",
cache: false,
dataType: "json",
success: function (data) {
$("#FCheckitemName").val(data.FCHECKITEMNAME).attr("readonly", true);
$("#FChecknatureCode").combobox("setValue", data.FCHECKNATURECODE).combobox('readonly', true);
$("#FPublicknatureCode").combobox("setValues", data.FPUBLICKNATURECODE).combobox('readonly', true);
$("#FUsuallynatureCode").combobox("setValues", data.FUSUALLYNATURECODE).combobox('readonly', true);
$("#FRemark").text(data.FREMARK).attr("readonly", true);
$("#addConfig").datagrid({
fit: false,// 高度自适应
/* width:600,
height:450,*/
rownumbers: true,//显示带有行号的列
striped: true,//把行条纹化
fitColumns: true,//自动扩大或缩小列的尺寸以适应网格的宽度并且防止水平滚动
pagination: true,//底部显示分页工具栏
singleSelect: false,//只允许选中一行
autoRowHeight: false,//是否设置基于该行内容的行高度。设置为 false,则可以提高加载性能
loadMsg: '正在加载数据...',//当从远程站点加载数据时,显示的提示消息。
columns: [[
{field: "sid", checkbox: true},
{
field: "FNATURENAME", width: 50, align: "center", title: "属性名称",
editor: {
type: 'textbox',
options: {
required: true
}
}
},
{
field: "FNATURECODE", width: 50, align: "center", title: "属性代码",
editor: {
type: 'textbox', options: {required: true}
}
},
{
field: "FDATATYPE", width: 50, align: "center", title: "属性值的数据类型",
editor: {
type: 'combobox',
options: {required: true, data: stage1, valueField: "id", textField: "text"},
},
formatter: function (value, row, index) {
for (var i = 0; i < stage1.length; i++) {
if (value == stage1[i].id) {
return stage1[i].text;
}
}
}
},
{
field: "FLENGTH", width: 50, align: "center", title: "属性值的最大长度",
editor: {
type: 'textbox', options: {}
}
}
]],
selectOnCheck: false,
/*注释这里 所有点击编辑行不可编辑*/
/*onDblClickRow: function (rowIndex, rowData) {
//双击开启编辑行
$("#addConfig").datagrid("beginEdit", rowIndex);
editRow = rowIndex;
rowArr.push(rowIndex);
if (editRow != beforeRow) {
$("#addConfig").datagrid("endEdit", beforeRow);
beforeRow = editRow;
}
},*/
onLoadSuccess: function () {
}
});
var options = $('#addConfig').datagrid('getPager').data("pagination").options;
var pageSize = options.pageSize;
var pageIndex = options.pageNumber;
$.ajax({
url: BASE_FRONT + "/specialcheckdef/getColumList",
type: "post",
data: {fId: id, pageIndex: pageIndex, pageSize: pageSize},
async: false,
dataType: "json",
success: function (data) {
debugger;
console.log(data);
debugger;
$("#addConfig").datagrid("loadData", {rows: data.rows, total: data.total})
}
});
}
});
}
total 大小正确