HORISONT SCROLL VERY URGENT - Page 2

HORISONT SCROLL VERY URGENT

2»

Replies

  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    SSOOOOOORRRRRRRRRYYYYYYYYYYY =)))

    It works perfectly!!!!!
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    ooo fuck! it just work in my example =(((
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    Hi,

    at least i understood in what problem! You previous advise (width="100%") works just if the width of data in a cell doesn't exceed the width of header (under which this cell is). https://www.meritservus.com/bug2.JPG

    But if for example the header will be "HEADER" (6 signs) and the data in cell will be DATADATADATA (12 signs). You will get a bug with a width of header again! Like https://www.meritservus.com/bag.bmp
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    Be that in defining table columns width to be 100%, as in the example below:

    [code]
    oTable = $("#example").dataTable({
    "sScrollY": "251px",
    "sScrollX": "100%",
    //...........//
    "aoColumns": [
    { "sClass": "center", "bSortable": false, "sWidth": "15%"},
    { "bSearchable": true, "sWidth": "15%", "sClass": "left" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "25%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" }
    ]
    });
    [/code]
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    aaa the problem that6 i don't want to use

    [code]
    "aoColumns": [
    06. { "sClass": "center", "bSortable": false, "sWidth": "15%"},
    07. { "bSearchable": true, "sWidth": "15%", "sClass": "left" },
    08. { "bSearchable": true, "sWidth": "15%" },
    09. { "bSearchable": true, "sWidth": "25%" },
    10. { "bSearchable": true, "sWidth": "15%" },
    11. { "bSearchable": true, "sWidth": "15%" }
    12. ]
    [/code]

    because user has a settings, using which the number of columns are changed dynamically!

    may be you know another way to fix it?
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    may be exist the way to get the max width of cell in this column at first, and after set this width to header sell?!

    ?
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    No matter the number of columns displayed for the column width will be proportionate to the definition changed then the initial columns.
    That initial definition must include the total width of columns.
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    You can try the following example:

    http://datatables.net/forums/comments.php?DiscussionID=2044&page=1#Item_1
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    no, this is completely differ that i need. My portal is written in Java, i use JSP, and my table are created dynamically depends from settings which user has!

    i don't use any json and etc....

    my table are created like:

    [code]




    NAME




    SSID




    BB TICKER




    ISSUER TYPE L1




    ISSUER TYPE L2


    and etc
    [/code]
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    I'm noticed that the number of columns is generated dynamically. That must, before generating the table, to initialize "Data Tables" with the number of columns and for each column to specify "sWidth"

    I'm sure it will be functional. You need to test the definition of "sWidth" for each column of the table. To the extent that the table will be generated with fewer columns, column width displayed will increase proportionally with the number of columns displayed.
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    "No matter the number of columns displayed for the column width will be proportionate to the definition changed then the initial columns.
    That initial definition must include the total width of columns. "

    But here something wrong! because really i saw that may columns have a width which not proportional to content!

    may be to re-init data table after some period of time?! i don't know ......
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    so if X-scroll is disabled, everything works good =(((((((((((((((((((((...............
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    Specifically, only True Scrolling is not yet implemented robust.

    http://datatables.net/forums/comments.php?DiscussionID=2016&page=1#Item_10

    Allan says:

    "
    1. True scrolling and markup: Unfortunately yes, when you enable scrolling in DataTables the table's markup has to be altered to break it into three div elements (header, body and footer). The reason for this is that it is simply not possible to get tbody scrolling to work reliably across all browsers - x scrolling already wouldn't allow the headers to move with it (I've seen this as a CSS problem in the past, but practicality stands in the way of that).

    It is also true that scroll will possibly make your tables more fragile, in that you need to be more aware of the layout. Setting the width to 100% is a good example. It makes sense that this needs to be done, when thinking about sizing, but is something that needs to be considered.
    "
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    i made as
    [code]
    "aoColumns": [
    { "bSearchable": true, "sWidth": "40%" },
    { "bSearchable": true, "sWidth": "40%" },
    { "bSearchable": true, "sWidth": "40%" },
    { "bSearchable": true, "sWidth": "40%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "15%" },
    { "bSearchable": true, "sWidth": "40%" },
    { "bSearchable": true, "sWidth": "40%" }
    ],
    [/code]

    it works worse than without it!
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    Sure, go bad, because total width of the columns exceeds 100%.
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    no, anyway it doesn't work! I think should be another way to fix it!

    how this scrolling was realized in jGrid for example?! there are no such problem! but another usability in jGrid worse than in DataTables!

    i don't know but I seem that problem in a first column! i think i set a wrong width to first column and another column are shifted because they depend from first one!
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    @iuliandum: can you explain me what is the rule DataTables use to define a proportionals of header's cells????
  • allanallan Posts: 63,192Questions: 1Answers: 10,412 Site admin
    @Trollchik: Can you post a link showing a table which doesn't work, or send me the markup for the table if you don't want it to be public ( http://datatables.net/contact ). If I have some example HTML which breaks the scrolling alignment, then hopefully I will be able to work with it to address the issue.

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    Thanks everyone! I played with width and now at least it works with any size of columns!!!

    I increase the width of header depend from number of columns, like: if i have 33 columns, I SET width 200%; if 12-24 - 150% and so on!

    So now using this scheme it works!
This discussion has been closed.