Laravel backpack how to order sequence of columns displayed in setUpListOperation

25 Views Asked by At

I am trying to develop a setUplistOperation function that is dynamic in a sense that whenever a new column is added into the database, the modifications made to the database automatically show up in the front end list view without necessary code modification in the form of creating a new column in setUpListOperation.

However, I have noticed that in the event the number of columns available in the database table exceeds the maximum number of columns that can be displayed in the responsive table design it will result in the latter columns being hidden.

Readjusting of column positions

  • When I try to adjust the position of a latter column to be after a column that is being displayed in the responsive table design, it doesn't process the change

  • protected function setupListOperation() {
    // Initial displaying of columns based on what is available in DB CRUD::setFromDb(); CRUD::column('nationality')->after('name'); }

  • enter image description here

Furthermore, if I reduce the number of columns in the table to only have name,avatar,status and nationality. There will not be any issues reordering the nationality column to go after the name sequence which indicates that in order to adjust the position of a column it has to first be one of the visible columns in the responsive table design.

0

There are 0 best solutions below