I got a problem with sScrollY

I got a problem with sScrollY

ericsunericsun Posts: 2Questions: 0Answers: 0
edited November 2014 in Free community support

Hi all, I am doing my job with this disgusting plugin. code is:

var addDetailDataTable = $('#addDetailConfig').DataTable({
        bPaginate: false,
        bInfo: false,
        bFilter:  true,
        bSort: true  , 
        bAutoWidth: true,
        bScrollInfinite: true,
        sScrollY: '240px',
        sScrollYInner: '100%',
        scrollCollapse: true,
        ScrollLoadGap: 6,
        paging: false,
        aoColumnDefs: [ { "bSortable": false, "aTargets": [ 0 ] }],
        oLanguage: {
            sProcessing: "Loading......",
            sLengthMenu: "Show _MENU_ Records",
            sZeroRecords: "Sorry, It's Empty!",
            sEmptyTable: "Sorry, It's Empty!",
            sSearch: ""
        }
    });

I need a vertical scroll, after add the code the table head float to the left and the width is 100px.

Nomatter what I do, including I specified the width in aoColumnsDef , I still cant resolve this problem.The version I used is 1.10.3.

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin

    Please link to a test page showing the issue, as noted in the forum rules.

    Also note there is no sScrollYInner option.

    Allan

  • ericsunericsun Posts: 2Questions: 0Answers: 0
    edited November 2014

    Thanks for your reply.I debug the source code.But I found no problems, where could I show my picture.This forum can't support to upload picture.I draw two simulator pictures as below:

        id   |    name  |   age  |   salary    |           comments
    ---------------------------------------------------------------------------
         1          eric        33       8,000                      no
    ---------------------------------------------------------------------------
         2        daniel      25      12,000                     no
    ---------------------------------------------------------------------------
         3        david       31       6,500                      no
    ---------------------------------------------------------------------------
    

    This table shows above is I need to render on the page.But the result table like this:

     id | name | age | salary | comments
    ---------------------------------------------------------------------------
         1          eric        33       8,000                      no
    ---------------------------------------------------------------------------
         2        daniel      25      12,000                     no
    ---------------------------------------------------------------------------
         3        david       31       6,500                      no
    ---------------------------------------------------------------------------
    

    The issue is that table head float to left.When I open the element detector and find that the plugin generate two tables and the first one is the thead also called the scroll_Head, and second one is scroll_Body.The width of outer div is 100px and the inner table width equals outerwidth.How does this 100px appear? I debug the source code and can not find 100px in jquery.dataTables.js, even can't find the 100px in my custom css file.Finnaly I find the 100px is define in the style attribute of div element.So the 100px is generated by plugin.

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin

    Can you please link to the page or create a test case showing the issue so we can debug it as I asked, and as noted in the forum rules?

    Thanks,
    Allan

This discussion has been closed.