Update DataTable.php
Add label to columns in getInitialResponse
I didn't see label in columns API : https://datatables.net/reference/option/columns. Maybe title ?
I don't think this will fix anything, as hinted by @maxhelias?
I didn't see
labelin columns API : https://datatables.net/reference/option/columns. Maybetitle?
https://github.com/omines/datatables-bundle/blob/master/src/Column/AbstractColumn.php#L156
I didn't see
labelin columns API : datatables.net/reference/option/columns. Maybetitle?https://github.com/omines/datatables-bundle/blob/master/src/Column/AbstractColumn.php#L156
https://datatables.net/reference/option/columns
Since I'm not aware of any bugs with column labels: what is currently broken and what does this fix do about it?
I just want to doublecheck why we should merge this, no issues with the change itself if it's needed.
Since I'm not aware of any bugs with column labels: what is currently broken and what does this fix do about it?
I just want to doublecheck why we should merge this, no issues with the change itself if it's needed.
It's not a bug but we need it to render the datatables with vueJS without jQuery
Ok so you're kinda abusing our public API and request a change in it to support a case outside of the scope of the project? 😉
For this case I would recommend staying inside the bounds of the bundle, and use DataTable->setTemplate to override our default HTML template - it has full access to all column configuration and allows you to prepare an HTML section with the column data as JSON which you can then further process as static data with Vue or React.
For reference this is the default template: https://github.com/omines/datatables-bundle/blob/master/src/Resources/views/datatable_html.html.twig
I want use this bundle as API without template twig, for this I need the label data.
I understand the use case, I'm just not comfortable with 'weighing down' the bundle's internal API for everyone based, on an unsupported scenario used by few (likely 'one').
I'm more open to solving this request with for example events or abstraction mechanisms. Technically, you can already do what you want, as the getInitialResponse method is protected you can just override it in a VueDataTable extends DataTable. It's not entirely pretty, granted, but it'll allow you to do more customization that you'll likely need.
Stale pull request message