sType Issue when links are introduced into some rows

sType Issue when links are introduced into some rows

aligreenealigreene Posts: 6Questions: 0Answers: 0
edited June 2010 in General
Hi there,

I've looked through several issues people have had with this, but the solutions don't seem to work for me. I have multiple rows, where some rows have links, others done. What's happening is the columns are sorting all links, then all non-links. I need the columns to sort all (links and non links) irrespective of whether there's a link tag associated with a piece of data. I've been using the "sType": "html" option, but it doesn't seem to recognise it. Dio you know if I need to use another option in conjunction with the sType?

Here's my javascript:
[code]

$(document).ready(function() {
$('.sort').dataTable({
"sPaginationType": "full_numbers",
"aoColumns": [
{"sType": "html"},
{"sType": "html"},
{"sType": "html"},
{"bSortable": false, "sType": "html"},
{"sType": "html"},
]
});
});

[/code]

and the table is as follows: (this is how the browser reads it, I can't give you the original, as it has django tags pulling the information into the tables):

[code]



Index Key
Title
Programme
Specialty
Other Versions



bbb
bbb
bbb
bbb
bbb

ddd
ddd
ddd
ddd
ddd

aaa
aaa
aaa
aaa
aaa

ccc
ccc
ccc
ccc
ccc



[/code]

Thanks,
Allison

Replies

  • aligreenealigreene Posts: 6Questions: 0Answers: 0
    I have tried it with non-dynamic data and I still can't get the sorting to work properly when links are added:

    [code]



    Index Key
    Title
    Programme
    Specialty
    Other Versions




    aaa
    aaa
    aaa
    aaa
    aaa


    bbb
    bbb
    bbb
    bbb
    bbb


    ccc
    ccc
    ccc
    ccc
    ccc


    ddd
    ddd
    ddd
    ddd
    ddd




    [/code]
  • aligreenealigreene Posts: 6Questions: 0Answers: 0
    Hi there,

    I made a slighte modification to the javascript, as IE threw up an error about the amount of td's it was expection, and so changed it to:

    [code]


    $(document).ready(function() {
    $('.sort').dataTable({
    "sPaginationType": "full_numbers",
    "aoColumns": [
    {"sType": "html"},
    {"sType": "html"},
    {"sType": "html"},
    {"sType": "html"},
    {"sType": "html"}
    ]
    });
    });

    [/code]

    And now it works in IE - but only in IE, not in Firefox, Opera or Chrome - is this a known issue for you? And I'd also really like to be able to specify "bSortable": false.

    Thanks,
    Allison
  • aligreenealigreene Posts: 6Questions: 0Answers: 0
    Hi Allan,

    Is there a way to get datatables to sort all, both links and non links in a given column? At the moment they seem to separate them during sorting.
  • aligreenealigreene Posts: 6Questions: 0Answers: 0
    Hi there,

    just wanted to update on the issue I was having with the links sorting separately from the non links in a column. Basically it was happening if there was empty space in the markup around the tags. For some reason any browser except IE would not sort the links amongst the non links. I feel a bit silly about how arbitrary my issue was, but just in case someone else was having a similar issue, they should check for spaces in their markup!
  • jkd77jkd77 Posts: 3Questions: 0Answers: 0
    I have the same issue and I have eliminated spaces from around my anchor links (see first column). Here is my page: http://lovefunding.werremeyer.com/loan-closings/

    Any ideas why the sort is still dividing between linked and non-linked content? I also have some code in place for sorting the column with dollar amounts: http://datatables.net/forums/discussion/comment/24475#Comment_24475

    Thoughts? Thanks!
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    I bet the newline between the and the is a factor. Your non-link cells don't have newline.
  • aligreenealigreene Posts: 6Questions: 0Answers: 0
    I think fbas is right, although we'd need to see your code as it is in your editor to know for sure - you never know how a browser will choose to format ...
This discussion has been closed.