2014-11-29 3 views
0

케이크 PHP와 함께 jqgrid를 사용하려고하면 페이지 매김이 작동하지만 추가, 생성, 삭제 기록이 작동하지 않습니다.케이크와 PHP와 jqgrid와 CRUD

public function edit(){ 

    $this->autoRender=false; 
    $oper=''; 

    $oper=$this->request->query['oper'];   
    if($oper=='add'){ 
    echo 'Add record'; 
    } 

    if($oper=='edit'){ 
    echo 'edit record'; 
    } 

    if($oper=='del'){ 
    echo 'delete record'; 
    } 
    } 

$oper=$this->request->query['oper'];

방법 편집은 정의되지 않은 인덱스를 보여줍니다 OPER [APP \ 컨트롤러 \ PeopleController.php, 라인 16]

내가 $_POST['oper'] 작품을 사용하는 경우.

페이지 매기기가 작동하며 변수를 수신하기 위해 동일한 방법을 사용하고 있습니다.

 $page = $this->request->query['page']; 
    $limit = $this->request->query['rows']; 
    $sidx = $this->request->query['sidx']; 
    $sord = $this->request->query['sord']; 

있는 jqGrid

$('#tb_people').jqGrid({ 
      url: "<?php echo $this->request->base ?>/people/listxml", 
      datatype: 'xml', 
      colNames: ['Id', 'Doc', 'Name', 'Telephone','Adress','Sex'], 
      colModel: [ 
       { 
        name: 'id', 
        index: 'id', 
        width: 80 
       }, 

       { 
        name: 'doc', 
        index: 'doc', 
        width: 200, 
        editable:true 
       }, 

       { 
        name: 'name', 
        index: 'name', 
        width: 200, 
        editable:true 
       }, 

       { 
        name: 'telephone', 
        index: 'telephone', 
        width: 80, 
        editable:true 
       }, 
       { 
        name: 'adress', 
        index: 'adress', 
        width: 80 
       }, 
       { 
        name: 'sex', 
        index: 'sex', 
        width: 80, 
        editable:true 
       }], 
      rowNum: 5, 
      rowList: [5,10,20,30,50], 
      pager: '#dv_paginador', 
      sortname: 'id', 
      viewrecords: true, 
      sortorder: 'asc', 
      xmlReader: { 
       root: 'rows', 
       row: 'row', 
       repeatitems: true, 
       id: '[id]' 
      }, 
      caption: 'People', 
      height: '100%', 
      editurl:"<?php echo $this->request->base ?>/people/edit" 
     }).jqGrid('navGrid', '#dv_paginator', { 
      search: false 
     });; 

답변

0

솔루션은 다음과 같다. $ _POST와

는 $ _GET와 $this->request->data('something')

가 전체 소스 코드를 here

입니다 $this->request->query['something']

사용할 필요가 사용하는 것이 필요하다