easyui datagrid 添加数据时页面不显示

easyui datagrid 添加数据时页面不显示

下面这种方式不得行,页面没有数据
$('#dg').datagrid('insertRow',{
        			index: 0,
        			row:{
        				rowNum:1,
        				stepType: '开始',
        				stepName: '提交申请',
        				postId: USER.userName
        			}
        		});
        		$('#dg').datagrid('insertRow',{
        			index: 1,
        			row:{
        				rowNum:2,
        				stepType: '结束',
        				stepName: '流程结束',
        				postId: '无'
        			}
        		});

这样添加,即使reload了也不会出来数据 ,只有在页面重新渲染的情况下数据才会出来(如按一下F12)

改为
var row = [{
        				rowNum:1,
        				stepType: '开始',
        				stepName: '提交申请',
        				postId: USER.userName
        			},{
	        				rowNum:2,
	        				stepType: '结束',
	        				stepName: '流程结束',
	        				postId: '无'
	        			
	        		}];

$(’#dg’).datagrid({data:row}); 数据正常加载

猜你喜欢

转载自blog.csdn.net/qq_26634873/article/details/106269484