Searched the Treegrid source code and documents found that the Treegrid is extended from the DataGrid and tree, but used to load the query result data by using the Reload method of the DataGrid in addition to the parameters. But Treegrid only executes reload cannot load query results with parameters, may be restricted, the following code cannot load query results:
Copy Code code as follows:
<table id= ' Treegrid ' class= ' easyui-treegrid ' url= '/user/list ' ></table>
$ (' #treegrid '). Treegrid (' reload ', {' name ': ' Mikel '});
Then went to the official forum search related issues, found a valuable post, enlightened, why do you expect the Treegrid component to asynchronously query the data, why not first asynchronously, and then load the returned JSON data? The code is as follows:
Copy Code code as follows:
function LoadData ()
{
$.post ('/user/list ', {name: ' Mikel '},function (data) {
$ (' #treegrid '). Treegrid (' LoadData ', data);
}, ' json ');
}