Recently, when querying the treegrid component, You need to dynamically update the query results of the treegrid component of EasyUI Based on the query conditions and search the treegrid source code and documentation. It is found that treegrid is extended from the datagrid and tree, however, in the past, query result data was loaded using the reload method and parameters of the datagrid. However, treegrid only executes the reload operation and does not include the query results with parameters. This may be due to restrictions, the following code cannot load query results:
The Code is as follows:
$ ('# Treegri'). treegrid ('reload', {'name': 'mikel '});
So I went to the official forum to search for related questions and found a valuable post. Why should I count on the treegrid component to asynchronously query data, what about loading the returned json data? The Code is as follows:
The Code is as follows:
Function loadData ()
{
$. Post ('/User/list', {name: 'mikel'}, function (data ){
$ ('# Treegri'). treegrid ('loaddata', data );
}, 'Json ');
}