跳动原因
第一和第二个框是获取头部的高度
最后一个框起的地方top = -25
执行 _6b1.scrollTop(_6b1.scrollTop()+top) 后会往下跳动
解决方法
1、将treegrid改成datagrid可以解决跳动
2、添加onLoadSuccess方法,此方法会隐藏序号,建议在后台手动添加序号解决
$('#dg').treegrid({
idField: 'id',
treeField: 'item',
fit:true,
fitColumns:true,
singleSelect:true,
checkOnSelect:true,
selectOnCheck:true,
autoRowHeight:true,
collapsible: true,
rownumbers: true,
toolbar:'#htTool',
url : "",
queryParams:{"checklistId":''},
onClickRow: onClickRow,
columns:[[
{field:'item',title:'检查项/分部项/子分部项', width:180},
{field:'checkContent',title:'检查项目实记分条款和记分值', width:300,
formatter: function(value) {
return "<span title='" + value + "'>" + value + "</span>";
}
},
{field:'score',title:'得分',width:60,editor:{type:'numberbox',options:{precision:1}}},
{field:'reason',title:'扣分理由', width:150, editor:'text'}
]],
toolbar:'#tb',
onLoadSuccess:function(){
var as = $(".datagrid-view1").find(".datagrid-btable");
for (var i = 0; i < as.length; i++) {
as[i].classList.add("datagrid-btable-frozen")
}
$(".datagrid-view1").hide()
}
});