2012-03-09 3 views
0

안녕하세요.jqGrid 필터 도구 모음이 보이지 않습니다.

웹 프로젝트에서 jqGrid를 사용하려고합니다. 모든 것이 좋지만 한 순간입니다. filterToolbar를 활성화하려고하지만 할 수 없습니다. 좋은 결과없이 많은 설명서와 예제를 사용했습니다. 크롬 및 Internet Explorer

: - : filterPanel 보이지 않는

버전 : jQuery를 그리드 브라우저있는 jqGrid 4.3.1 그리드

  1. 데이터는
  2. 정렬이
  3. 문제 좋은 좋은

    제발 내 코드 좀 봐. 고마워요.

    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
    <link rel="stylesheet" type="text/css" media="screen" href="css/redmond/jquery-ui-1.8.18.custom.css" /> 
    <link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" /> 
    <script src="js/jquery.js" type="text/javascript"></script> 
    <script src="js/i18n/grid.locale-en.js" type="text/javascript"></script> 
    <script src="js/jquery.jqGrid.min.js" type="text/javascript"></script> 
    </head> 
    <body> 
    <table id="listU05"></table> 
    <div id="pager"></div> 
    
    
    <script type="text/javascript"> 
    $(document).ready(function(){ 
    $("#listU05").jqGrid({ 
    url:'u05json.json', 
    datatype: 'json', 
    mtype: 'POST', 
    colNames:[ 
        'thema' 
    ], 
    colModel :[ 
        {name:'Thema', index:'Thema', width:55} 
    ], 
    pager: '#pager', 
    rowNum:10, 
    rowList:[10,20,30], 
    sortname: 'Thema', 
    sortorder: 'asc', 
    viewrecords: true, 
    gridview: true, 
    caption: 'My first grid11', 
    width:200 
    }); 
    }); 
    jQuery("#listU05").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false,  defaultSearch : "cn"}); 
    </script> 
    
    </body> 
    

답변

2

나는 문제가 당신이$(document).ready 이벤트 핸들러 $(document).ready(function(){...});filterToolbar외부의 전화를 배치한다는 것입니다 생각합니다. 결과적으로 filterToolbar,은 그리드가 생성되기 전에 호출됩니다. 의 호출을 $(document).ready 이벤트 처리기 끝으로 이동하면 문제가 해결됩니다.

앞에 !DOCTYPE 선언을 포함해야합니다. 예를 들어 <!DOCTYPE html> 또는 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 일 수 있습니다.

+0

올레그, 고마워요. – mad

+0

@ 마드 : 환영합니다! – Oleg

관련 문제