Skip to content

Commit

Permalink
table.View: createViewData() => remove the param #6342
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Jan 29, 2025
1 parent 7f6e849 commit cb91035
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/draggable/table/header/toolbar/SortZone.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SortZone extends BaseSortZone {
owner.updateDepth = 2;
owner.update();

owner.parent.view.createViewData(owner.parent.view.store.items)
owner.parent.view.createViewData()
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/table/Container.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Container extends BaseContainer {
headerToolbar.createItems()
}

me.view?.createViewData(me.store.items)
me.view?.createViewData()
}
}

Expand Down Expand Up @@ -407,12 +407,12 @@ class Container extends BaseContainer {
}

/**
* @param {Array} inputData
*
*/
createViewData(inputData) {
createViewData() {
let me = this;

me.view.createViewData(inputData);
me.view.createViewData();

if (me.useCustomScrollbars && me.scrollbarsCssApplied === false) {
me.applyCustomScrollbarsCss()
Expand Down Expand Up @@ -478,15 +478,15 @@ class Container extends BaseContainer {
let me = this;

if (me.rendered) {
me.createViewData(data);
me.createViewData();

if (me.store.sorters.length < 1) {
me.removeSortingCss()
}
} else {
me.on('rendered', () => {
me.timeout(50).then(() => {
me.createViewData(data)
me.createViewData()
})
}, me, {once: true})
}
Expand Down
20 changes: 10 additions & 10 deletions src/table/View.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,17 @@ class View extends Component {
}

/**
* @param {Object[]} inputData
*
*/
createViewData(inputData) {
let me = this,
amountRows = inputData.length,
i = 0,
rows = [],
{selectedRows} = me;

for (; i < amountRows; i++) {
rows.push(me.createRow({record: inputData[i], rowIndex: i}))
createViewData() {
let me = this,
{selectedRows, store} = me,
countRecords = store.getCount(),
i = 0,
rows = [];

for (; i < countRecords; i++) {
rows.push(me.createRow({record: store.items[i], rowIndex: i}))
}

me.vdom.cn = rows;
Expand Down

0 comments on commit cb91035

Please sign in to comment.