Easyui datagrid does not display the page when adding data

Easyui datagrid does not display the page when adding data

The following method cannot work, the page has no data
$('#dg').datagrid('insertRow',{
        			index: 0,
        			row:{
        				rowNum:1,
        				stepType: '开始',
        				stepName: '提交申请',
        				postId: USER.userName
        			}
        		});
        		$('#dg').datagrid('insertRow',{
        			index: 1,
        			row:{
        				rowNum:2,
        				stepType: '结束',
        				stepName: '流程结束',
        				postId: '无'
        			}
        		});

Add this way, even if it is reloaded, the data will not come out. The data will come out only when the page is re-rendered (for example, press F12)

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

$('#dg').datagrid((data:row)); Data is loaded normally

Guess you like

Origin blog.csdn.net/qq_26634873/article/details/106269484