樹形下拉列表

<div id="uCUserFunctionLogtext" style="padding:3px;" class="panlheader">        
                    <span style="padding-left:20px;">功能名稱:</span>
                    <t:comboTree url="functionController.do?setPFunction" id="fun_satree" name="modelName">
                    </t:comboTree>

                    <span style="padding-left:20px;">用戶登錄名:</span>
                    <input id="userCode" name="userCode" type="text" style="width: 120px" class="inputxt" />
                    <span style="padding-left:20px;">用戶名稱:</span>
                    <input id="userName" name="userName" type="text" style="width: 120px" class="inputxt" />
                    <span style="padding-left:20px;">使用時間:</span>
                    <input id="userDate_begin" name="userDate_begin" type="text" style="width: 120px" class="Wdate" onClick="WdatePicker()"/>
                    ~
                    <input id="userDate_end" name="userDate_end" type="text" style="width: 120px" class="Wdate" onClick="WdatePicker()"/>
                </div>
        </div>

下面是Script

<script type="text/javascript">
 $(document).ready(function(){
         //給時間控件加上樣式
         $("#userDate_begin").find("input[name='userDate_begin']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
         $("#userDate_end").find("input[name='userDate_end']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
  function mysearch(){
          var modelId = $("#fun_satree").combotree("getValue")  //獲取id
            var userCode = document.getElementById('userCode').value;
            var userName = document.getElementById('userName').value;
            var userDate_begin = document.getElementById('userDate_begin').value;
            if(userDate_begin=="" || userDate_begin==undefined) {
                alert("請選擇開始時間");
                return;
            }
            var userDate_end = document.getElementById('userDate_end').value;
            if(userDate_end=="" || userDate_end==undefined) {
                alert("請選擇結束時間");
                return;
            }
            var queryParams=$('#uCUserFunctionLogList').datagrid('options').queryParams;
                    queryParams['modelId']=modelId;  //傳參
                    queryParams['userCode']=userCode;
                    queryParams['userName']=userName;
                    queryParams['userDate_begin']=userDate_begin;
                    queryParams['userDate_end']=userDate_end;                
            $('#uCUserFunctionLogList').datagrid({
                url:'uCUserFunctionLogController.do?datagrid&field=id,modelName,userCode,userName,userDate,counts',   //通過上面傳的id就可以獲取到它的name
                pageNumber:1
            });
        }
 </script>



發佈了38 篇原創文章 · 獲贊 21 · 訪問量 17萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章