Questions about dynamic column generation in datagrid

Source: Internet
Author: User
Tags jqgrid
Requirements for dynamic column generation in the datagrid: dynamically generates columns based on the selected time period. The following figure shows how to modify the column name in the datagrid after clicking the 'Go 'button after the selected time period? Please give me a simple example ------ solution -------------------- & lt; div & nbsp; & gt; & lt; table & nbsp; idsalesqu datagrid dynamic column generation
Requirement: generate columns dynamically based on the selected time range, as shown below:

After selecting a time period, click the 'go' button. how can I modify the column name in the datagrid? Please give me a simple example.
------ Solution --------------------


Data-options = "url: 'Get _ salesquantityper. php', singleSelect: true, rownumbers: true"
>


Category




// Include "t. php ";
InitRows1 ($ x1, $ x2); // The initRows1 method is output correctly.
?>


InitRows2 ($ x1, $ x2 );
?>




Use a container to enclose the datagrid container. after the query, clear the datagrid code generated by easyui in the container. easyui does not provide the method to change the columns configuration or deregister the datagrid, you can only remove the datagrid by clearing the container. If the jqgrid you are using provides the function of canceling jqgrid

Click to query
Certificate ('{dvdatagrid'{.html ('
 
 
')
// Refer to your other post. obtain the columns content using ajax and then call $ ('# salesquantityper'). datagrid () to generate a datagrid object to load the new columns configuration and data.

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.