jquery easyui datagrid detailView 碰到的问题,点击+号显示详细信息竟然出现这种样式(如图),谢谢
代码如下view:detailview,detailFormatter:function(rowIndex,rowData){alert(rowIndex);return...
代码如下view:detailview,
detailFormatter: function(rowIndex, rowData){
alert(rowIndex);
return "<div id='detailDiv"+rowIndex+"' style='color:black;border:0px;'><div/>";
},
onExpandRow: function(index,row){
alert(index);
loadDetailView(row.controller_no,index);
var ddv = $(this).datagrid('getRowDetail',index).find('detailDiv'+index);
ddv.panel({
height:80,
border:false,
cache:false,
onLoad:function(){
$('#dataGridContr').datagrid('fixDetailRowHeight',index);
}
});
}
function loadDetailView(controlNo,index) {
var detailHtml="";
$.ajax({
type : "post",
url : "harddevdefinfo/queryHardPointDef.htm",
data : {controller_no : controlNo},
dataType: "json",
success : function(data) {
var detailHtml="<table style='width:100%;color:blue' border='0'>";
$.each(data,function(i,list){
detailHtml+="<tr><td>"+(i+1)+"</td><td>"+list.point_door_name.trim()+"</td>";
detailHtml+="<td>延时"+list.point_delay+"秒(s)</td>";
detailHtml+="<td><strong>门点的配置状态:</strong>"+list.point_config_status+"</td></tr>";
});
detailHtml+="</table>";
$('#detailDiv'+index).html(detailHtml);
},
error : function(err) {
}
});
} 展开
detailFormatter: function(rowIndex, rowData){
alert(rowIndex);
return "<div id='detailDiv"+rowIndex+"' style='color:black;border:0px;'><div/>";
},
onExpandRow: function(index,row){
alert(index);
loadDetailView(row.controller_no,index);
var ddv = $(this).datagrid('getRowDetail',index).find('detailDiv'+index);
ddv.panel({
height:80,
border:false,
cache:false,
onLoad:function(){
$('#dataGridContr').datagrid('fixDetailRowHeight',index);
}
});
}
function loadDetailView(controlNo,index) {
var detailHtml="";
$.ajax({
type : "post",
url : "harddevdefinfo/queryHardPointDef.htm",
data : {controller_no : controlNo},
dataType: "json",
success : function(data) {
var detailHtml="<table style='width:100%;color:blue' border='0'>";
$.each(data,function(i,list){
detailHtml+="<tr><td>"+(i+1)+"</td><td>"+list.point_door_name.trim()+"</td>";
detailHtml+="<td>延时"+list.point_delay+"秒(s)</td>";
detailHtml+="<td><strong>门点的配置状态:</strong>"+list.point_config_status+"</td></tr>";
});
detailHtml+="</table>";
$('#detailDiv'+index).html(detailHtml);
},
error : function(err) {
}
});
} 展开
1个回答
展开全部
你在
ddv.panel({
height:80,
border:false,
cache:false,
onLoad:function(){
$('#dataGridContr').datagrid('fixDetailRowHeight',index);
}
});
中,再加一个onResize监听事件试试:
onResize:function(){
$('#dataGridContr').datagrid('fixDetailRowHeight',index);
}
在你panel的onLoad事件之后
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询