fix: 그리드 페이지 type에 따른 페이지 정보 위치 fix

main
Jonguk. Lim 2 years ago
parent 7a322cf5ad
commit e01d748ed2

@ -76,9 +76,10 @@ class CustomRowNumberRenderer {
} }
getRowNum(props) { getRowNum(props) {
const currentPage = props.grid.getPagination()._currentPage; // paging 처리시 : scroll인 경우 제외
const currentPage = props.grid.getPagination()?._currentPage;
// You can change the number `5` as your perPage option. // You can change the number `5` as your perPage option.
return Number(props.formattedValue) + (currentPage - 1) * props.grid.getPagination()._options.itemsPerPage; return Number(props.formattedValue) + (currentPage - 1) * props.grid.getPagination()?._options?.itemsPerPage;
} }
getElement() { getElement() {
@ -140,16 +141,18 @@ const TuiGrid = {
this.instance = null; this.instance = null;
// rowNum fix // rowNum fix
options.rowHeaders.filter((r, idx) => { if(options.pageOptions?.type !== 'scroll') {
if(r === 'rowNum'){ options.rowHeaders.filter((r, idx) => {
options.rowHeaders[idx] = { if (r === 'rowNum') {
type: 'rowNum', options.rowHeaders[idx] = {
renderer: { type: 'rowNum',
type: CustomRowNumberRenderer renderer: {
type: CustomRowNumberRenderer
}
} }
} }
} })
}) }
const newOptions = $.extend(true, {}, this.defaultOptions, options, {data: dataSource}); const newOptions = $.extend(true, {}, this.defaultOptions, options, {data: dataSource});
newOptions.el = document.getElementById(options.el); newOptions.el = document.getElementById(options.el);
//this.elId = options.el; //this.elId = options.el;

Loading…
Cancel
Save