≡

Editor datatable field: unexpected empty table and pagination

Editor datatable field: unexpected empty table and pagination

GargiucnGargiucn Posts: 124Questions: 34Answers: 0

I'm using a datatable field in Editor with multiple: true and select.style: 'multi+shift'.

The available options are displayed correctly, but underneath the list another empty table appears, showing:

"No data available in table"

"Showing 0 to 0 of 0 entries"

Pagination controls

This happens even though I've configured paging: false and info: false.

I've attached a screenshot.

Could this be related to a compatibility issue between DataTables, Editor and Select, or am I missing something in the field configuration?

Thanks!
Giuseppe

Answers

  • kthorngrenkthorngren Posts: 22,519Questions: 26Answers: 5,173
    edited November 9

    Looks like you defined an Editor field with the datatable field type like this example. The info is showing the Datatable doesn't have any records. At a minimum please post your Editor config so we can understand exactly what you have and how you are trying to populate the Datatable.

    Kevin

  • GargiucnGargiucn Posts: 124Questions: 34Answers: 0

    This message simply appears when updating DataTables and the editor from version 2.x to 3.x

  • kthorngrenkthorngren Posts: 22,519Questions: 26Answers: 5,173

    It's difficult to help debug without any information about your config. Please at a minimum please post your Editor config. Better is a link to a test case showing the issue so we can help debug.

    Kevin

  • allanallan Posts: 66,179Questions: 1Answers: 11,039 Site admin

    It almost (but not quite) looks like it is initialising twice.

    As Kevin indicates, are you able to send me a link to a test case so I can debug it?

    Allan

  • GargiucnGargiucn Posts: 124Questions: 34Answers: 0
    {
                    name: "mansioni[].man_id",
                    type: 'datatable',
                    multiple: true,
                    config: {
                        language: {
                            search: "Mansioni",
                            searchPlaceholder: 'Cerca...',
                            url: 'plugins/italian.json'
                        },
                        columns: [
                            {
                                title: 'Elenco mansioni',
                                data: 'label'
                            }
                        ],  
                        select: {
                            style: 'multi+shift'
                        },
                        ordering: false,
                        searching: true,
                        info: false,
                        paging: false,
    
                   ** !!!!-->  scrollY: 364, <-- this is the problem!!!!**
                        
                                           scrollCollapse: true 
                    }
                },  
    
  • allanallan Posts: 66,179Questions: 1Answers: 11,039 Site admin

    I've not been able to reproduce this yet unfortunately. This example uses scrollY for the table and doesn't show the same problem. I've also tried using your exact configuration object from above (although I changed the language.url to load from the CDN), but it works okay:

    Are you able to give me a link to the page you are working on?

    Allan

  • GargiucnGargiucn Posts: 124Questions: 34Answers: 0

    I know, I can’t figure it out.
    It happens with DataTables 3.1.5, but if I go back to DataTables 2.3.7, everything works perfectly...

  • allanallan Posts: 66,179Questions: 1Answers: 11,039 Site admin

    If you can't give me a link to the page, can you show me the full JS?

    Allan

Sign In or Register to comment.