2010-03-06 4 views
1

버튼에 새 열을 추가하고 싶습니다. jqGrid를 클릭하십시오. 다음은 격자를 정의하는 데 사용하는 코드입니다. 누군가가 나를 도와 줄 수있는 방법, 위치와 새로운 열을 정의합니다.jqGrid의 버튼을 클릭하여 새 열을 추가하고 싶습니다.

jQuery("#list").jqGrid({ 
    datatype: "local", 
    height: 250, 
    colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], 
    colModel:[ 
     {name:'id',index:'id', width:60, sorttype:"int",editable:false,editoptions:{readonly:true,size:10}}, 
     {name:'invdate',index:'invdate', width:90, sorttype:"date",editable:true,editoptions:{readonly:false,size:25}}, 
     {name:'name',index:'name', width:100, editable:true,editoptions:{readonly:false,size:20}}, 
     {name:'amount',index:'amount', width:80, align:"right",sorttype:"float", editable:true, editoptions:{readonly:false,size:20}}, 
     {name:'tax',index:'tax', width:80, align:"right",sorttype:"float", editable:true,editoptions:{readonly:false,size:20}}, 
     {name:'total',index:'total', width:80,align:"right",sorttype:"float", editable:true,editoptions:{readonly:false,size:20}}, 
     {name:'note',index:'note', width:150, sortable:false, editable:true,editoptions:{readonly:false,size:20}} 
     ], 
    rowNum:10, 
    rowList:[10,20,30], 
    sortname: 'id', 
    viewrecords: true, 
    sortorder: "desc", 
    editCaption: "Edit Record", 
    caption: "Manipulating Grid Data", 
    editurl:"someurl.php" 
}); 

답변

0

그것은 당신을 요구하고 있지만 우리는 우리가 그들을 표시 할 테이블의 모든 열을 포함하여이를 달성하지만, "숨겨진 : 사실"로 정확히 무엇을 우리가 원하는 것들에 대한 특성 처음에 감추어 져야한다.

그런 다음 jqGrid showCol 메서드를 호출하여 사용자가 요청할 때 해당 열을 표시하는 jQuery 마법의 "열 표시"목록이 있습니다.

관련 문제