DataTable search problem

DataTable search problem

pwmusicpwmusic Posts: 4Questions: 0Answers: 0
edited May 2010 in General
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

Replies

  • codingavenuecodingavenue Posts: 22Questions: 0Answers: 0
    Hi,

    Have you tried this?
    http://datatables.net/usage/columns#sType

    codingavenue
  • pwmusicpwmusic Posts: 4Questions: 0Answers: 0
    edited May 2010
    Hi

    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]
This discussion has been closed.