sType Issue when links are introduced into some rows
sType Issue when links are introduced into some rows
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
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
This discussion has been closed.
Replies
[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]
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
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.
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!
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!