easyUI中datetimebox和combobox的取值方法

时间:2023-05-20 22:50:18
easyUI中datetimebox和combobox的取值方法

easyUi页面布局中,查询条件放在JS中,如下

<script type="text/javascript">
 var columnList = [ [
   {
    'id' : 'applyStartTime',
    'text' : '申请开始时间',
    'type' : 'datetimebox'
   },
   {
    'id' : 'applyEndTime',
    'text' : '申请结束时间',
    'type' : 'datetimebox'
   },
   {
    'id' : 'applyStatus',
    'text' : '申请状态',
    'type' : 'combobox',
    'options' : 'valueField:\'itemNo\',\'textField\':\'itemName\',panelMaxHeight:100,url:\''
      + CONTEXT_PATH
      + '/code/getItemList.json?codeNo=APPLY_STATUS\''
   },
   {
    'id' : 'orderStatus',
    'text' : '放款状态',
    'type' : 'combobox',
    'options' : 'valueField:\'itemNo\',\'textField\':\'itemName\',panelMaxHeight:100,url:\''
      + CONTEXT_PATH
      + '/code/getItemList.json?codeNo=ORDER_STATUS\''
   } ] ];
 var submitType = "Map";
</script>

如何取上面查询条件的值呢?

如下解决:

//获取参数
   var applyStartTime = $("#applyStartTime").datetimebox("getValue");
   var applyEndTime = $("#applyEndTime").datetimebox("getValue");
   var applyStatus =$("#applyStatus").combobox('getValue');
   var orderStatus = $("#orderStatus").combobox('getValue');