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,8 +141,9 @@ const TuiGrid = {
this.instance = null; this.instance = null;
// rowNum fix // rowNum fix
if(options.pageOptions?.type !== 'scroll') {
options.rowHeaders.filter((r, idx) => { options.rowHeaders.filter((r, idx) => {
if(r === 'rowNum'){ if (r === 'rowNum') {
options.rowHeaders[idx] = { options.rowHeaders[idx] = {
type: 'rowNum', type: 'rowNum',
renderer: { renderer: {
@ -150,6 +152,7 @@ const TuiGrid = {
} }
} }
}) })
}
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