2017-04-24 7 views
0

jsgrid 편집 단추의 기본 기능을 인라인 편집기에서 편집 할 다른 페이지를 여는쪽으로 변경하고 싶습니다. 나는 그것을 정확하게하는 방법을 모르겠다. 어떤 아이디어를 어떻게 페이지를로드하는 기본 편집 버튼을 변경 달성 할 수 있습니까? 그게 가능한가? 지금까지 내가 가지고 :jsgrid : 편집 버튼에 페이지로드를 추가 하시겠습니까?

코드 :

<script> 
    $(document).ready(function() { 
     $("#jsGrid").jsGrid({ 
      height: "398px", 
      width: "100%", 
      inserting: true, 
      editing: true, 
      sorting: true, 
      paging: true, 
      autoload: true, 
      pageSize: 10, 
      pageButtonCount: 5, 
      deleteConfirm: "Do you really want to delete your job listing?", 
      controller: { 
       loadData: function(filter) { 
        return $.ajax({ 
         type: "GET", 
         url: "<?php echo site_url('/job/getjobs/'.$this->session->employer_id); ?>", 
         data: filter 
        }); 
       }, 
       insertItem: function(item) { 
        return $.ajax({ 
         type: "POST", 
         url: "/clients/", 
         data: item 
        }); 
       }, 
       updateItem: function(item) { 
        return $.ajax({ 
         type: "PUT", 
         url: "/clients/", 
         data: item 
        }); 
       }, 
       deleteItem: function(item) { 
        return $.ajax({ 
         type: "DELETE", 
         url: "/clients/", 
         data: item 
        }); 
       } 
      }, 
      fields: [ 
       { name: "title", title: "Title", type: "text", width: 100 }, 
       { name: "created_on", title: "Created On", type: "text", width: 100 }, 
       { name: "salary", title: "Salary", type: "text", width: 100 }, 
       { name: "is_active", type: "text", title: "Is Active", width: 100 }, 
       { type: "control" } 
      ] 
     }); 
    }); 

</script> 

답변

2

나는 팝업, JQuery와 대화 상자를 사용하지만, 당신은 부트 스트랩 대화처럼, 너무 뭔가 다른 동등한를 사용할 수 있습니다.

나는 행을 클릭하여 편집을 연결, 내 코드는 같은 것입니다 :

$("#jsGrid").jsGrid({ 
    ... 
    rowClick: function(args) { 
     showDialog(args.item); 
    }, 
    ... 
); 

showDialog 팝업을 실행하는 기능입니다. 선택한 행은 args.item에서 사용할 수 있습니다. 이 도움이

$("#jsGrid").jsGrid("updateItem", updatedItem); 

희망 : 사용자가 저장에

는 다음, showDialog 기능에, 나는 다음 또한 그리드에 영향을받는 행을 갱신 할 jsGrid의 업데이트 방법을 실행하는 데 다음 사용합니다.