bSort doesn't work in new version

bSort doesn't work in new version

TrollchikTrollchik Posts: 80Questions: 1Answers: 0
edited October 2010 in General
Hi Allan! i'm using a new version of DataTables v 1.3. and i have next 2 problems:

1. When i try to use FixedColumns, i have the problems with the first column. U can see screenshots here:
http://www.meritkapital.com/screen1.JPG

the config of my table is:

[code]
oTable = j('#portfolioTable').dataTable({

"sPaginationType": "full_numbers",
"iDisplayLength": 10,
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],

"sScrollX": "100%",
"sScrollY": "100%",
"bJQueryUI": true,
});

new FixedColumns( oTable );
[/code]

2.The next problem, i don't need to have sorting and tried to use "bSort":false, but all my header become white color,as :
http://www.meritkapital.com/screen2.JPG

please, how i can resolve it?

Thanks a lot!

Replies

  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    Allan, i think i found a bug! I used next config with ur example and got white header as in second screen above!

    [code]
    var oTable = $('#example').dataTable( {
    "sPaginationType": "full_numbers",
    "bJQueryUI": true,
    "bScrollCollapse": true,
    "bSort": false

    } );
    [/code]
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Hi Trollchik,

    You are indeed quite correct - thanks for picking that up! I've just committed a fix for this, and you can grab the development version from the 'nightly' option on the downloads page ( http://datatables.net/download/ ) which has this fix in it. It will be included in the next release.

    Regards,
    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    Thanks Allan, now it works good!

    next question, i have the table like: http://www.meritkapital.com/screen1.JPG

    do u have some class, which u can assign to row and this row will consider as a group row??

    i mean i should have in a table like "COMMODITIES" - main group, "INDEX" - subgroup, and after other entries. and i will have a few group, subgroup and so on....

    i found groupping function, but it's very complicated. Bcs i have jsp and my table is building dinamically, so i can't know what rows is group/subgroup from JS.

    Thanks a lot!
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Basically the answer is no - there is no row grouping option in DataTables at this time. Having said that, it is possible to trick it into doing grouping using a hidden column and the aaSortingFixed initialisation parameter. You'd assign a number to each group, and put that into the hidden column. Then fixed sorting will force the rows to stay together. However, filtering does not take account of this - and will remove any rows which do not match the filter (since they are treated independently).

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    but if i press sort, will it sort rows in the group?
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Sort of... The fixed sorting forces that column to be sorted first - so you can control the order of the rows by using that. Then the sort will move on to the column which is being sorted on and is visible. It does mean that the group at the top will always be at the top. So basically it's not a great solution... Really it needs proper support added into DataTables.

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    Please, let me know when u will have such functionality! THanks! also i don't know the reason, but may be u can help! i have 2 tabs, and by one table on each, like:

    http://www.meritkapital.com/screen1.JPG

    but when i mobe to "BENCHMARK" tab, i see that my header in the column doesn't displayed!

    http://www.meritkapital.com/screen2.JPG

    if i ress refresh , eberything becomes ok!



    what is the problem?
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    The second link is giving a 404 error, so I'm afraid I can't say, but if I have to guess, I'd say take a look at this example of how to use scrolling and tabs: http://datatables.net/examples/api/tabs_and_scrolling.html

    Also the row grouping functionality will likely be a while off. Probably DataTables v2.1 or later - I'm not sure yet...

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    sorry, i frogot to upload last screen =)))

    can u lokk now!
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    also i did as in ur example, but it doesn't help me! may be bcs i use setting in tabs config

    [code]
    cookie: {
    // store cookie for a day, without, it would be a session cookie
    expires: 1
    },
    [/code]

    this is a full config:

    [code]
    j("#tabs").tabs({
    collapsible: true,
    cookie: {
    // store cookie for a day, without, it would be a session cookie
    expires: 1
    },
    "show": function(event, ui) {
    var cTable = j('div.dataTables_scrollBody>tabs', ui.panel).dataTable();
    if ( cTable.length > 0 ) {
    cTable.fnAdjustColumnSizing();
    }
    }
    [/code]
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    That looks about reasonable. Do you get any errors or anything? Is cTable a valid DataTables object?

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    no any errors! i'll play again with this page, may be i'll be able to find a reason!
This discussion has been closed.