我正在将JqGrid与javascript一起使用。 我想为每个表格行设置30px的固定高度,但是我没有这样做
这是我的代码:
我尝试使用loadComplete函数(在下面的代码中)并将CSS添加到特定的网格中,但是没有用。
jQuery("#IL_DealInsiderListsGrd").jqGrid({
datatype: "local", // or server, considr delay
height: 250,
data: gridsMap["DM_InsiderListData"] ? gridsMap["DM_InsiderListData"].data : [],
colModel:[
{label: 'List ID', name:'listId',index:'listId', width:150, sorttype:"text", key:true},
{label: 'Status', name: 'status',index:'status', width:150},
{label: 'Short Description', name:'shortDesc',index:'shortDesc', width:250,
editable: true, edittype:'text'},
{label: 'Description Info', name:'descInfo',index:'descInfo', width:250,
editable: true, edittype:"textarea", formatter:'', editoptions:{rows:"3", dataInit: gridTextarea}},
{label: 'Audit Date', name:'auditDate',index:'auditDate', width:150, sorttype:"date"}
],
//multiselect: true,
pager: '#IL_DealInsiderListsGrd_Pager',
rowNum:6,
rowList:[6,10,20],
cellEdit : true,
cellsubmit : 'clientArray',
loadComplete: function() {
var grid = $("#IL_DealInsiderListsGrd");
var ids = grid.getDataIDs();
for (var i = 0; i < ids.length; i++) {
grid.setRowData ( ids[i], false, {height: 20+i*2} );
}
//grid.setGridHeight('auto');
},
beforeSelectRow: function(rowid, event) {
setRowEditable($(this), rowid, !($(this).jqGrid('getRowData', rowid).status === 'Cleansed'))
return true;
},
afterSaveCell: function(rowid, cellname, value, iRow, iCol) {
if(!value.trim()) {
showAlert("Field is mandatory");
$(this).jqGrid('restoreCell', iRow, iCol);
}
else {
$(this).jqGrid('setCell', rowid, "auditDate", getDatetimeString());
}
}
});
答案 0 :(得分:0)
尝试使用chrome调试器查找行的css类。
然后在CSS中设置以下内容(将["src/**/*", "../kotlin/**/*"]
替换为找到的类)
your-css-class