jquery datatable 的搜索框无法显示?

页面加载datatable控件,搜素框无法显示
页面

<div id="data">
    <table id="dataList" width="100%" align="center">
        <thead>
            <tr>
                <th width="3%" align="center">&nbsp;</th>
                <th align="center">排序数</th>
                <th align="center">项目号</th>
                <th align="center">部门编号</th>
                <th align="center">项目名称</th>
                <th align="center">项目负责人</th>
                <th align="center">录入日期</th>
                <th align="center">申报金额(万元)</th>
                <th align="center">项目书状态</th>
            </tr>
        </thead>
        <tbody>    
        </tbody>
        <tfoot><th colspan="9" align="center">注:双击行进入维护页面</th></tfoot>    
    </table>
</div>

调用

    TableTools.DEFAULTS.aButtons = [];
    dataList = $("#dataList").dataTable({                      
             //"sScrollY": "100%",
             "bScrollCollapse": true,
             "bPaginate": true,
             "bJQueryUI": true,
             "sPaginationType": "full_numbers",
             "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "全部"]],             
             "bLengthChange":true,                                                    
             "oLanguage": {
                    "sUrl": "<%=systemPath%>/js/jquery-ui-1.9.2.custom/js/dataTables_cn.txt"
             },
             "sDom": '<"H"Trl>t<"F"ip>',
             "bProcessing": true,
             "bServerSide": true,
             "sAjaxSource": "<%=systemPath%>/zx/xmsb/web/action/ShowGetProjectListAction.do?Info=show&rand="+Math.random(),
             "fnServerData" : function(sSource, aoData, fnCallback) {
                $.ajax({    
                    "type" : "get",    
                    "contentType" : "application/json",    
                    "url" : sSource,    
                    "dataType" : "json",    
                    "data" : {      
                        aoData :jsonArryToStringQuery(aoData)
                    }, // 以json格式传递    
                    "success" : function(resp) { 
                           fnCallback(resp);
                           $("#dataList tbody tr").each(function(){
                            var bh = $("td:eq(2)",this).html();
                            var state = $("td:eq(8)",this).html();
                               if(bh==""||bh.trim()==""){
                                   
                               }else{
                                   $(this).dblclick(function(){
                                var flag = $("#flag").val();
                                if(state=="已保存"||state=="审核退回"||state=="批复退回"){
                                    window.location="<%=systemPath%>/zx/xmsb/web/action/ShowUpdateProjectReporAction.do?doaction=edit&lsh="+bh+"&flag="+flag;
                                }else{
                                    window.location="<%=systemPath%>/zx/xmsb/web/action/ShowUpdateProjectReporAction.do?doaction=check&method=update&lsh="+bh+"&flag="+flag;
                                }
                                })
                               }
                            
                        })    
                    }
                 });
             },
             "aoColumns": [
                   { "sName": "rownum" , "sClass": "center" ,
                      "bSearchable": false,
                    "bSortable": false},
                  { "sName": "px" , "sClass": "center" },
                  { "sName": "lsh" , "sClass": "center" },
                  { "sName": "bmbh" , "sClass": "center" },
                  { "sName": "xmmc" , "sClass": "center" },
                  { "sName": "fzr" , "sClass": "center" },
                  { "sName": "lrrq" , "sClass": "center" },
                  { "sName": "sbje" , "sClass": "center" ,
                    "fnRender": function (oObj) {
                        var value = oObj.aData[7];
                        if(value == "0.00"||value == ""||value == null){
                            value = "0.00";
                        }else{
                            value=parseFloat(value).toFixed(2);
                        }
                        return value;
                    }
                  },
                  { "sName": "state" , "sClass": "center" }
             ]
             
             
             
             
        });    

搜索框无法显示,求助

回复
阅读 5k
2 个回答

找到原因了参数"sDom"的问题~

新手上路,请多包涵

"searching":true

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏