2017-12-21 22 views
0

guiStyle이 부트 스트랩으로 설정된 상태에서 무료 jqgrid 4-15-3을 사용하고 있습니다. 문제는 navGrid "+"버튼에서 시작된 Add 대화 상자가 기본적으로 Model 대화 상자라는 것입니다. addParms에서 "model : fasle"을 설정했지만 효과가 없습니다. 또한 jQuery UI 대화 상자 "옵션"을 "모델"로 설정하여 afterShowForm을 변경하는 데 실패했습니다. 아래는 코드 스 니펫입니다. 가능한 해결책은 무엇입니까?모덜리스에 폼 (추가) 대화 상자 설정

$("#mygrid").jqGrid("navGrid", "#mygrid_nav", {add:true,...},{}, 
{ model:false, 
    afterShowForm: function(form){ 
     $(form).closest(".ui-jqdialog").dialog("option", "model", false); 

} }

업데이트 :

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8" /> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <link href="/Content/jquery-ui.min.css" rel="stylesheet"/> 
    <link href="/Content/ui.jqgrid.css" rel="stylesheet"/> 
    <script src="/Scripts/jquery-1.10.2.js"></script> 
    <script src="/Scripts/jquery-ui.min.js"></script> 
    <script src="/Scripts/jquery.jqgrid.src.js"></script> 
    <script src="/Scripts/grid.locale-en.js"></script> 
</head> 
<body> 
    <div> 
     <div> 
     <div> 
    <table id="tbl_test"></table> 
    <div id="div_test_pager"></div> 
    </div> 
    </div> 
    </div> 

<script type="text/javascript"> 
    $(function() { 
     $("#tbl_test").jqGrid({ 
      datatype: "local", 
      colNames: ['Col 1', 'Col 2'], 
      colModel: [ 
       { name: 'col1', index: 'col1', editable: true, width: 200 }, 
       { name: 'col2', editable: true, width: 100 } 
      ], 
      pager: "#div_test_pager", 
      height: 200, 
      caption: "Test" 
     }); 
     $("#tbl_test").jqGrid("navGrid", "#div_test_pager", 
      { edit: false, add: true, del: false, search: false, refresh: false } 
      /*no difference*/ 
      //,{}, {modal: false} 
     ); 
    }); 
</script> 
</body> 
</html> 

어떤 도움을 주셔서 감사합니다 : 다음과 같이 간단한 테스트, 동일한 결과를 생성!

는 (?. 올렉 또는 누군가가 힌트를 줄 감사를 많이 알고 있습니다)

답변

0

단어를 사용모델은 정확하지 않습니다 - 단어 MODA 설정에리터로하고 호출에 교체 대화 상자 기능

+0

감사합니다. 둘 다 수정 된 후 동일합니다. 또한 afterShowForm에서 대화 상자 함수를 호출 할 때 "초기화 전에 대화 상자에서 메서드를 호출 할 수 없습니다"라는 예외가 있습니다. 대화 상자가 jqgrid에서 초기화 된 후에 작성할 수있는 이벤트 핸들러가없는 것 같습니다. –