fnDisplayRow with url hash

fnDisplayRow with url hash

MDWMDW Posts: 3Questions: 0Answers: 0
edited July 2011 in Plug-ins
Dear all,

I would like to use the fnDisplayRow function / plug-in to display a specific page of paginated results according to a hash in the URL.

Having read an earlier post:
http://www.datatables.net/forums/discussion/391/fndisplayrow-with-url-hash/p1

I see it is possible, but I cannot get it to work.

I have included the plug-in, and can jump to a page by node number successfully

[code]oTable.fnDisplayRow( oTable.fnGetNodes()[8] );[/code]

But following the other advice on that earlier post to attempt to locate the node position by the hash leaves me with an error message: "a.nodeName is undefined"

So I guess my questions is, how do I extract the node position number from my table by hash, or by id for that matter.

Each row of the table has an tag like so:

Many thanks in advance, and congratulations on an amazing plugin.

Mark

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Mark,

    To confirm my understanding - you know what the hash is that you want to display, but you need a reference to the target node in order to pass it to fnDisplayRow? In which case you could do something like this:

    [code]
    var n = $('#post123', oTable.fnGetNodes() )[0];
    oTable.fnDisplayRow( n );
    [/code]

    Allan
This discussion has been closed.