Responsive Issue

Responsive Issue

SeppelchenSeppelchen Posts: 69Questions: 25Answers: 1

Hello,
we had insert responsive css and js and also:

    $(document).ready(function() {
    var dtInstanceNew = $('#readbdbartikel').dataTable( 
    {
        responsive: {
      details: {
        type: 'column',
        target: 1
      }
    },
        "processing": true,
        "oLanguage": {
        "sProcessing": "",
        },
        "serverSide": true,
        "ajax": "DataTables/ServerSide/server_bdbartikel_processing.php"
    } );

But I dont know why we cant see "+" or "-" before row ...:( We cant see all deatils...
We only can see that some was hide now. Could someone help please?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,696Questions: 1Answers: 10,500 Site admin

    Can you link to the page showing the issue so we can debug it please.

    Allan

  • SeppelchenSeppelchen Posts: 69Questions: 25Answers: 1
    edited October 2015

    Hello Allan,
    I will submit mail. I cant post public link...:(

    Edit:
    Link and login data was submit via email.

  • allanallan Posts: 63,696Questions: 1Answers: 10,500 Site admin

    Thanks for the login details. It looks like you need to add a class to the column that you want to have as the control column since you are using the column control option (the +/- display can only be automatically displayed if you use the default display options).

    Have a look at this example to see how it is done with the columns.className option.

    Allan

  • SeppelchenSeppelchen Posts: 69Questions: 25Answers: 1
    edited October 2015

    Hello Allan,
    could you post how we can do this. We try and try and get no success. :(

    Add JS Code:

    $(document).ready(function() {
        var dtInstanceNew = $('#readbdbartikel').dataTable( 
        {
            responsive: {
          details: {
            type: 'column',
          }
        },
         columnDefs: [ {
                className: 'control',
                orderable: false,
                targets:   0
            } ],
            "processing": true,
            "oLanguage": {
            "sProcessing": "",
            },
            "serverSide": true,
            "ajax": "DataTables/ServerSide/server_bdbartikel_processing.php"
        } );
    

    And <th></th> tags. Now we get:
    DataTables warning: table id=readbdbartikel - An SQL error occurred: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 10' at line 5

    Could you please review and help?
    Please Allan.

  • allanallan Posts: 63,696Questions: 1Answers: 10,500 Site admin
    Answer ✓

    You've added an empty th cell to the table - did you update your sever-side processing script to take account of that extra column? If not, then that is obviously the issue.

    Can I make a suggestion? Try to simplify it. Try just:

    $(document).ready(function() {
        var dtInstanceNew = $('#readbdbartikel').dataTable(
        {
            responsive: true,
            "processing": true,
            "oLanguage": {
            "sProcessing": "",
            },
            "serverSide": true,
            "ajax": "DataTables/ServerSide/server_bdbartikel_processing.php"
        } );
    

    That will show the show / hide button in the first column of the table.

    If you want it to be shown in a specific column then you will need to update your server side processing code.

    Allan

  • SeppelchenSeppelchen Posts: 69Questions: 25Answers: 1

    Hello,
    now it will work but, while loading table i can see it will display all column for some second while loading. Could we also solve this short bug?

  • allanallan Posts: 63,696Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Sorry, but that is simply how the Responsive aspect operates at this time.

    I will at it to my list of things to look at, but is going to be more complex than a 5 minute job.

    Allan

  • SeppelchenSeppelchen Posts: 69Questions: 25Answers: 1

    Hello Allan,
    but i think you had solve this before. Because if i review another responsive table it seems better work with display. Should I submit both links via mail?

  • SeppelchenSeppelchen Posts: 69Questions: 25Answers: 1

    All solved now. :) Thanks.

This discussion has been closed.