DataTable search problem
DataTable search problem
Hi
I have created a new DataTable and it works very well apart from in one respect.
The DataTable will be used to display a list of courses with the first in each row holding the course title enclosed in an anchor tag.
The search option also examines the text enclosed in the href within the anchor tag and I'd like to stop it doing this whilst still allowing it to search the course name.
In the following code, searching for courses with 'module' as part of the course name matches ALL rows (due to 'modules' being part of the URL):
[code]
Course
Location
English Literature
Chelmsford
Education support modules
Chelmsford
Course
Location
[/code]
Has anyone encountered this before and found a way round it?
Many thanks
Patrick
I have created a new DataTable and it works very well apart from in one respect.
The DataTable will be used to display a list of courses with the first in each row holding the course title enclosed in an anchor tag.
The search option also examines the text enclosed in the href within the anchor tag and I'd like to stop it doing this whilst still allowing it to search the course name.
In the following code, searching for courses with 'module' as part of the course name matches ALL rows (due to 'modules' being part of the URL):
[code]
Course
Location
English Literature
Chelmsford
Education support modules
Chelmsford
Course
Location
[/code]
Has anyone encountered this before and found a way round it?
Many thanks
Patrick
This discussion has been closed.
Replies
Have you tried this?
http://datatables.net/usage/columns#sType
codingavenue
The link you directed me to gave me all the information I needed to sort the issue, so many thanks for replying.
(In case anyone else encounters this and is looking for a solution I've included the changed code.)
[code]
$('#example').dataTable(
{
"aoColumns":
[
{ "sType": "html" },
null,
null,
null,
null
]
}
);
[/code]