This topic contains 4 replies, has 2 voices, and was last updated by Sean Sean 2 years, 9 months ago.

Managed Data tables do not work when columns are increased!


  • Mak
    Participant

    Posts: 7
    Member Reply #1150

    This question is related to Managed Data Tables. I am building a website with php and mysql.. everything works fine.. I am using a managed data table in a page.. by default it has 6 columns in metronic theme, I integrated php and it worked fine with 6 columns of table. Now the thing is I want to show 10 columns in the table, I made it 10 columns, then data tables stopped working!

    I can see the table.. but it is not paginated, there are records per page drop down etc. Do I need to configure number of columns in any file?

    • This topic was modified 2 years, 9 months ago by  Mak.

    Mak
    Participant

    Posts: 7
    Member Reply #1152

    Attaching two images .

    Working condition with 6 columns

    Working condition

     

    Not working condition with 9 columns for example

     

    Sean
    Sean
    Keymaster

    Posts: 4206
    Support Staff Reply #1158

    Hi :),

    If you change the table columns you should change the JS code that initializes the table. More info can be found from the official site of the plugin – datatables.net

    Thanks.


    Mak
    Participant

    Posts: 7
    Member Reply #1165

    Thanks for the reply. I checked their forum and found a clue! then I worked on it!

    in table-managed.js , there is a code specifying columns. They were only 6!

    
    "columns": [{
    "orderable": false
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }],
    
    

    I made it as as per my number of columns. I have 12 columns. so the code looks like this now

    
    "columns": [{
    "orderable": false
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }, {
    "orderable": true
    }],
    
    
    • This reply was modified 2 years, 9 months ago by  Mak.
    Sean
    Sean
    Keymaster

    Posts: 4206
    Support Staff Reply #1180

    Hi :),

    Cool! Glad you figure it out. Good luck with your project!

    To stay updated on Metronic’s new releases please follow us on http://twitter.com/keenthemes 😉

    Thanks.

You must be logged in to reply to this topic.