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.