MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

re-run resolve function for columns containing dot in the name #516

Open kirba opened 1 year ago

kirba commented 1 year ago

This one should solve #505

The issue when exporting was both export and re-render are happening in the single request. The 2nd time query is built, it starts fresh (from builder method) but columns are already resolved.

Column doesn't have any join info stored in it so the join is missing and thus generating Unknown column error. It is because resolveColumnName will change query directly.

That being said, there is a workaround for this bug. If we define builder function in our class, and we do a manual join there, then everything will be fine. But still, I think this one should be solved in the library.