JEECG Extended Package Query condition time period query

Source: Internet
Author: User

Small partners developed with the JEECG framework know that adding a query condition, usually we add a configuration (query= "true"), allows the field to be set as a query condition. Simple and convenient. However, such a configuration query condition applies only to input box input queries and drop-down box queries (if you configured the field using replace). Obviously, such query conditions can not meet our needs, the most common is the time period query, as well as the time period and other fields mixed query situation, the following simple solution.

Custom query criteria,

First step: query= "true" for all configurations in the field, and query= "false" to tell the framework I don't need you to generate a query condition for me

Second step: Add a div below <t:datagrid></t:datagrid>, this div is to place the query conditions, and in the div configuration you need to query conditions.

<div style= "PADDING:3PX; height:70px "> <div name=" searchcolums "style=" float:left; padding-left:15px; " > <span> <span style= "vertical-align:middle;display:-moz-inline-box;display:inline-block;w idth:80px;text-align:right; "title=" Order number > Order number: </span> <input type= "text" Name= "OrderNo"Style=" width:100px; height:24px; " > <span style= "vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right; "title=" Customer Name > Customer Name: </span> <input type= "text" Name= "Clientid.name"Style=" width:100px; height:24px; " > <span style= "vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right, "title=" license plate number > license plate number: </span> <input type= "text" Name= "Licenseplatenumber"Style=" width:100px; height:24px; " > <span style= "vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 80px;text-align:right, "title=" charge status > Charge status: </span> <select name= " State"style=" width:80px "> <option value=" "> Please select </option> <option value=" 1 "             > Fee Success </option> <option value= "0" > Charge failure </option> </select> <br/> <br/> <span style= "Vertical-align:middle;display:-moz-inline-box;displa y:inline-block;width:90px;text-align:right; "title=" appearance time > Appearance time: </span><input type= "text" name= "Outtime_begin" style= "width:100px; height:24px;" >~ <input type= "text" name= "Outtime_end" style= "width:100px; height:24px; margin-right:20px; " ></span> <a href= "#"class= "Easyui-linkbutton" iconcls= "Icon-search"onclick= "Deductionlistsearch ();"style= "text-align:right;width:670px" > Inquiries </a> <a href= "javascript:void (0)"class= "Easyui-linkbutton" iconcls= "Icon-putout" onclick= "Exportexcel ();" > Export excel</a> </div></div>

The third step: refer to the above code, there are several places to be aware.

  1. Red is the name of the query field you need to set, and the name corresponds to the Field field name in <t:dgCol> in your <t:datagrid></t:datagrid>
  2. The Blue is the time period of the configuration, here you only need to put two input box, and then add the following code in the JS code:
    $ (document). Ready (function () {        $ ("input[name= ' Outtime_begin ')"). attr ("Class", "Wdate"). attr ("style" , "height:20px;width:90px;"). Click (function () {Wdatepicker ({datefmt: ' Yyyy-mm-dd '})        ; $ ("input[name= ' Outtime_end ')"). attr ("Class", "Wdate"). attr ("style", "height:20px;width:90px;"). Click (function () {Wdatepicker ({datefmt: ' Yyyy-mm-dd '});})    ;

  3. This method of standard powder must pay attention to, need us to write? Of course no, but when you name it, be sure to note that it is your <t:datagrid></t:datagrid> 's named Plus search () build.
  4. <t:datagrid name= "Testlist" > For example, I now have the name Testlist, then the method name is Testlistsearch (); This is because the framework encapsulates the query rules.

Fourth: This custom query condition the foreground has been completed. Background if it is a normal configuration of the query conditions, the use of the Criteriaquery.add () method on the line, all parameters can be obtained through the request, of course, you do not need to do so.

Here is a copy:

JEECG Extended Package Query condition time period query

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.