After searching the treegrid source code and documents, I found that treegrid is extended from datagrid and tree. However, in the past, the reload method of datagrid was used to load query result data by adding parameters. However, treegrid only executed reload and could not load query results with parameters. It may be that Due to the restriction, the following code cannot load query results:
< table id='treegrid' class='easyui-treegrid' url='/User/List'>
$('#treegrid').treegrid('reload',{'name': 'mikel'});
So I went to the official forum to search for related issues and found a valuable post. I suddenly understood why we should rely on the treegrid component to query data asynchronously. Why not asynchronously first, and then What about loading the returned json data? The code is as follows:
function loadData()
{
$.post('/User/List',{name:'mikel'},function(data){
$('#treegrid').treegrid('loadData',data);
} ,'json');
}