jqGrid에 자주 사용되는 Method

Single selection 이 적용된 경우

$( "{gridtableid}" ).getGridParam( "selrow" );
$( "{gridtableid}" ).jqGrid('getGridParam', "selrow" );

Multi selection 이 적용된 경우

$( "{gridtableid}" ).jqGrid('getGridParam', 'selarrrow');
$( "{gridtableid}" ).getGridParam('selarrrow');

Row Data 가져오기

$( "{gridtableid}" ).jqGrid('getRowData', rowid);
$( "{gridtableid}" ).getRowData( rowid );

clear

$grid.jqGrid('clearGridData');

reload

$grid.trigger('reloadGrid');

get id

var ids    = $grid.jqGrid('getDataIDs');
var rowIds = $grid.getDataIDs();

get data []

var rowDatas = $grid.jqGird('getRowData');
var rowDatas = $grid.getRowData();

get data {}

var obj = $grid.jqGird('getRowData', rowid);
var obj = $gird.getRowData(rowid);

add

$grid.jqGrid('addRowData', row.id, data);
$grid.addRowData(rowid, data, position, srcrowid);
$grid.addRowData(rowid, data);

update

$grid.jqGrid('setRowData', rowid, data, {cssProp});
$grid.setRowData(rowId, data, {cssProp});

delete

$grid.jqGird('delRowData', rowid);
$grid.delRowData(rowid);

getGridParam

var selRowId = $Grid.getGridParam('selrow');
var selRowIds = $Grid.getGridParam('selarrrow');
var selRowId = $Grid.jqGrid('getGridParam','selrow');
var selRowIds = $Grid.jqGrid('getGridParam','selarrrow');
var postData = $Grid.jqGrid('getGridParam','postData');
var records = $Grid.jqGrid('getGridParam','records');  // 총 row 개수

setGridParam

$Grid.setGridParam({'postData' : postData}).trigger('reloadGrid');
$Grid.jqGrid('setGridParam', {'postData' : postData}).trigger('reloadGrid');

setSelection(rowid, onSelectRowEvent)

$Grid.setSelection('001', false);
$Grid.jqGrid('setSelection', '001', false);

resetSelection()

$Grid.resetSelection();
$Grid.jqGrid('resetSelection');

출처: https://4urdev.tistory.com/50 [Simplify]

You may also like...

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다