1. Page section (Introduction of the corresponding JS)
class= "w40 tl Pl10" > From date:</td> <td> class= "Easyui-datebox stdfrm-b2" name= "Mdatebegin" id= "Mdatebegin" style= "width:158px" data-options= "Validtype: ' Date ', height:23" ></input> </td> class= "w40 tl Pl10" > To date:</td> <td> class= "Easyui-datebox stdfrm-b2" name= "Mdateend" id= "Mdateend" style= "width:158px" data-options= "Validtype: ' Date ', height:23" ></input> </td>
<span style= "FLOAT:LEFT;MARGIN-LEFT:80PX;MARGIN-TOP:12PX;" ><a href= "javascript:void (0)" class= "Easyui-linkbutton" data-options= "iconcls: ' Icon-fi-search '" style= "width : 80px "onclick=" doquery (); " > Enquiry </a></span>
2.js
/***/function doquery () { $ (' #dg_menu '). DataGrid (' Reload ', {' Mdatebegin ': $ (' #mDateBegin '). Datebox (' GetValue '), ' mdateend ': $ (' #mDateEnd '). Datebox (' GetValue ') ), ' code ': $ (' #mealtime '). ComboBox (' GetValue ') });
3. Backstage
PublicString Querymenu ()throwsexception{httpservletrequest Request= This. Getrequest (); String Mdatebegin= Request.getparameter ("Mdatebegin"); String Mdateend= Request.getparameter ("Mdateend"); String type= Request.getparameter ("code"); if("Select". Equals (Type) {Type=NULL; } if(Conditions = =NULL) {conditions=NewArrayList (); } if (mdatebegin! = null &&!mdatebegin.equals ("")) {Condition C1 = new Condition (); C1.setpropertykey ("Mdate"); C1.setpropertyexpression (">="); C1.setpropertyvalue (Mdatebegin); Conditions.add (C1); } if (mdateend! = null &&!mdateend.equals ("")) {Condition C2 = new Condition (); C2.setpropertykey ("Mdate"); C2.setpropertyexpression ("<="); C2.setpropertyvalue (Mdateend); Conditions.add (C2); } if(Type! =NULL&&!type.equals ("") {Condition C3=NewCondition (); C3.setpropertykey ("Mealtime"); C3.setpropertyexpression ("="); C3.setpropertyvalue (type); Conditions.add (C3); } map Map= (MAP) This. Menuservice.querymenu (conditions, pager, sorter); Jsonconfig.registerjsonvalueprocessor (Date.class,Newjsondatevalueprocessor ()); This. Utf8responsewriter (). Write (Jsonobject.fromobject (map, Jsonconfig). toString ()); return NULL; }
The above code is not complete,
Cond......
Easyui setting and implementation of the date range front and rear table