akveo / ng2-smart-table

Angular Smart Data Table component
https://akveo.github.io/ng2-smart-table/
MIT License
1.63k stars 876 forks source link

colspan for noDataFound case is not calculated properly with custom action #629

Open chknim opened 6 years ago

chknim commented 6 years ago

When action's add, edit, delete are all set to false and action's custom is added, empty table does not set colspan property properly (colspan value is one less than it's supposed to be). I have a solution here below.

https://github.com/akveo/ng2-smart-table/blob/8f37d374a87a9008328aaea36ad6ce78a28ce7a8/src/ng2-smart-table/components/tbody/tbody.component.ts#L50

this.isActionDelete = this.grid.getSetting('actions.delete');
+ this.isActionCustom = !!this.grid.getSetting('actions.custom');

https://github.com/akveo/ng2-smart-table/blob/8f37d374a87a9008328aaea36ad6ce78a28ce7a8/src/ng2-smart-table/components/tbody/tbody.component.html#L53

- <td [attr.colspan]="grid.getColumns().length + (isActionAdd || isActionEdit || isActionDelete)">
+ <td [attr.colspan]="grid.getColumns().length + (isActionAdd || isActionEdit || isActionDelete || isActionCustom)">
chknim commented 6 years ago

PR here. https://github.com/akveo/ng2-smart-table/pull/631

gabmarini commented 6 years ago

+1

farissi commented 6 years ago

The repo seems to be inactive :( how to get this implemented to the project?

rizz5091660 commented 5 years ago

same goes here, no data found row is not correctly calculate number of column when applying settings = {selectMode: 'multi'...}

hanalice commented 3 years ago

PR here. #631

@chknim the PR is not pass the check, so it hasn't been merged. Pls have a look.

chknim commented 3 years ago

Thanks for checking. I'm not using this lib anymore so does not really matter to me.

My change is so simple so feel free to port into your own PR.

On Tue, Nov 10, 2020 at 2:09 AM hanalice notifications@github.com wrote:

PR here. #631 https://github.com/akveo/ng2-smart-table/pull/631

the PR is not pass the check, so it hasn't been merged. Pls have a look.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/akveo/ng2-smart-table/issues/629#issuecomment-724509795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5SRU6WNEWLPBKN6TCNQSLSPDRL5ANCNFSM4EF5S4GA .

mouazAlkhodari commented 2 years ago

@chknim i have made new PR that do the same thing mentioned here you can find it here #1307 i hope it could be merged asap