easyui datagrid不等待后台返回数据就显示页面

yeqichao001 yeqichao001 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

$("#tabLine").datagrid({
title:'信息',
width:"100%",
height: 500,
url:'<%=lineUrl%>',
loadMsg:'数据装载中......',
rownumbers:true,
pagination : true,
idField:'id',
//nowrap: false,
rownumbers:true,
fitColumns:true,
pageSize:10,
pageList:[1,10],
toolbar:[{
text:'修改',
iconCls:'icon-edit',
handler: doUpdate
},"-",{
text:'批量修改',
iconCls:'icon-edit',
handler: updataMore
},"-",{
text:'查看',
iconCls:'icon-search',
handler: doDetail
}],
frozenColumns:[[
{field:'ck',checkbox:true}
]],
onClickRow : function(rowIndex,rowData){
$(this).datagrid('unselectAll');
$(this).datagrid('selectRow', rowIndex);
},//鼠标单击
onDblClickRow:function (rowIndex,rowData){
}, //双击
onBeforeLoad: function(){
$('#tabLine').datagrid('unselectAll');
$("#tabLine").datagrid('loadData',[]);
},
onLoadSuccess : function() {
},
columns:[[
{title:'id',width:100,field:'id',hidden:true},
{title:'编码',width:100,field:'partnumber',align:'center'},
{title:'型号',width:100,field:'devicemodel',align:'center'},
{title:'描述',width:200,field:'descriptionchn',align:'center'}
]]
});
});

以上是datagrid部分代码,奇怪的是,有时候提交查询请求,后台数据还没返回,前台页面就显示了,
loadMsg中的 '数据装载中......' 信息出现后,不等待后台返回数据,就直接消失。
结果,进行调试时发现,虽然后台能查出数据,但页面还是经常显示为空白。
求教大神,有没有什么建议,能够保证页面在后台数据返回后再显示。
...全文
评论 5
收藏 已收藏
分享
返回顶部
yeqichao001
JavaScript 87,984 成员 224,681 内容