Solution to dynamic data loading of the treegrid component of EasyUI _ jquery

Source: Internet
Author: User
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 ');
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.