This topic contains 12 replies, has 4 voices, and was last updated by Sean Sean 1 year, 10 months ago.

Metronic Data Tables Error


  • bala16
    Participant

    Posts: 8
    Member Reply #2584

    I need to add more than six columns in the data tables. if i add more than 5, search and pagination not working properly.. What can i do…


    bala16
    Participant

    Posts: 8
    Member Reply #2594

    Can, Any One Solve This Problem..

    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #2596

    Hi :),

    Please note when you add a new column you will need to adjust it in the datatable initialization script. Please look at the demo HTML page you are referring to and check the datatable’s initialization script(e.g: assets/admin/pages/scripts/table-managed.js). For more info please check a full documentation of the plugin: http://www.datatables.net.

    If you need any further help please provide us more details(reference page, which demo are you using, a test link to your developing site, etc) so we can provide you more effective support.

    Thanks.


    bala16
    Participant

    Posts: 8
    Member Reply #2602

    <span style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>In Metronics theme datatables column are fixed, i need to add more than 5 columns, I cant find any variables or fields in </span><span style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>table-managed.js. please tell exact varibale i need to change fixed column length.. U dont understand any thing, just tell i send site link..</span>

    • This reply was modified 2 years, 9 months ago by  bala16.
    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #2613

    Hi,

    Can you please let us know which demo page(from the original theme source) are you referring ? Will it be possible to get a test link to your developing site ? Without checking your code we will not be able to predict your issue.

    Thanks.

    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #2619

    Hi :),

    Please try to adjust below part:

    “columns”: [{
    “orderable”: false
    }, {
    “orderable”: true
    }, {
    “orderable”: false
    }, {
    “orderable”: false
    }, {
    “orderable”: true
    }, {
    “orderable”: false
    }],

    When ever you add a new column just add an option for the newly added columns under the above columns parameter.

    Thanks.


    bala16
    Participant

    Posts: 8
    Member Reply #2684

    <p style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>reference site url:</p>
    <p style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>1. http://aptitudestudios.in/<wbr />check/userList.php</p>
    <p style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>2. http://aptitudestudios.in/<wbr />check/userList1.php</p>
    <p style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>In 1st link datatables are working perfectly, because i use 5 columns only.</p>
    <p style=”color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;”>In 2nd link data tables search and pagination not working correctly, please check this.</p>
     

    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #2690

    Hi,

    Your post contains a link to a website thats not related to Mertronic. Can you provide us proper URL to the issue page ?

    Thanks.


    RamGLB
    Participant

    Posts: 1
    Member Reply #6782

    Hi
    actually I’m using AJAX datatable, in which pagination alone is not working..
    what would be the possible problem, and whats the solution for it..

    Thanks 🙂

    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #6795

    Hi,

    You will need to change the ajax data source script(e.g: the php script) under “demo” folder in order to handle 6 columns.
    If you are referring to table_datatables_ajax.html demo then you will need to check table-datatables-ajax.js script where the ajax datatable is initialized and the ajax data is retrieved from the source set through “src” parameter.

    If you need any further clarifications please let us know.

    Thanks.


    xenorious
    Participant

    Posts: 2
    Member Reply #6844

    Hello!

    I am trying to add a sixth column to the editable datatable and I get an error! What should I do in javascript in order to add another column?

    Thanks in advance.


    xenorious
    Participant

    Posts: 2
    Member Reply #6850

    Hello,

    I figured out how to add columns, thank you so much for the feedback!
    I would now like to ask the following question:

    On an editable table, once the edit button is pressed, is it possible to NOT let the user edit one of the boxes? I want to disable the edit on some boxes once the edit button is pressed.

    Thank you very much.

    Sean
    Sean
    Keymaster

    Posts: 4444
    Support Staff Reply #6857

    Hi,

    You are welcome. For this you will need to do some customizations on the editable datatables code in table-datatables-editable.js. Please refer to the below function and just customize it to make of columns uneditable:

    function editRow(oTable, nRow) {

    var aData = oTable.fnGetData(nRow);

    var jqTds = $(‘>td’, nRow);

    jqTds[0].innerHTML = ‘<input type=”text” class=”form-control input-small” value=”‘ + aData[0] + ‘”>’;

    jqTds[1].innerHTML = ‘<input type=”text” class=”form-control input-small” value=”‘ + aData[1] + ‘”>’;

    jqTds[2].innerHTML = ‘<input type=”text” class=”form-control input-small” value=”‘ + aData[2] + ‘”>’;

    jqTds[3].innerHTML = ‘<input type=”text” class=”form-control input-small” value=”‘ + aData[3] + ‘”>’;

    jqTds[4].innerHTML = ‘<a class=”edit” href=””>Save</a>’;

    jqTds[5].innerHTML = ‘<a class=”cancel” href=””>Cancel</a>’;

    }

    Thanks.

You must be logged in to reply to this topic.