Jqgrid中日期字段列的搜索功能范围内(从 - 到)

时间:2015-05-19 10:16:21

标签: jquery jqgrid

我需要在日期范围内过滤记录。

我尝试了这段代码,但它不起作用。

我只添加了一个datePicker,我无法添加日期范围。

<script type="text/javascript" charset="utf-8">
$(document).ready(function () {
            <jqgrid:grid id="records" url= "'${createLink(action:'list')}'"
                colNames="'ID','Status','Created Date','Last Updated'"
                colModel="
                    {name:'Id',index: 'id', width:'150'},
                    {name:'status', width:'105'},               
                    {name:'dateCreated',search:true,sortable:true, formatter:'date',formatoptions: { srcformat: 'ISO8601Long', newformat:'M d, Y H:i'},searchoptions:{dataInit:datePick}},
                    {name:'lastUpdated',search:false,sortable:false, formatter:'date',formatoptions: { srcformat: 'ISO8601Long', newformat:'M d, Y H:i'}}"
                 sortname="'dateCreated'"
                 sortorder ="'desc'"
                 caption="'&nbsp;'"
                 height="'auto'"
                 width="800"
                 rowNum="30"
                 autowidth="true"
                 viewrecords="true"
                 showPager="true"
                 datatype="'json'">

                <jqgrid:filterToolbar id="records" searchOnEnter="false" />
                <jqgrid:navigation id="records" add="false" edit="false" del="false" search="false" refresh="false"/>
                <jqgrid:refreshButton id="records" />
            </jqgrid:grid>


        });

        datePick = function(elem)
        {
           jQuery(elem).datepicker({changeYear: true,
               changeMonth: true});
        }
 </script>

0 个答案:

没有答案