ypnos-web / cakephp-datatables

CakePHP3 Plugin for DataTables plug-in for jQuery
MIT License
27 stars 24 forks source link

Display linked table count in one column #68

Closed renjithjr closed 5 years ago

renjithjr commented 6 years ago

Is it possible ?

ypnos-web commented 6 years ago

In your finder you can create that column for the query output and then just display as usual. However, the way I do it is that I use CounterCache behavior: https://book.cakephp.org/3.0/en/orm/behaviors/counter-cache.html

renjithjr commented 6 years ago

Concatenate two or more columns into single column ?

ypnos-web commented 6 years ago

Write a render callback for that. See https://github.com/ypnos-web/cakephp-datatables/blob/master/webroot/js/cakephp.dataTables.js#L202 for an example. Use full parameter to access other columns' values.