fnOpen() and bServerSide

fnOpen() and bServerSide

mauftarkiemauftarkie Posts: 2Questions: 0Answers: 0
edited September 2009 in Bug reports
Hi,

First off, thanks for the great plugin. It allows me to do awesome things quite easily and makes me a Very Happy codemonkey.

I ran into this issue: I couldn't use fnOpen()/fnClose() on a bServerSide generated table, since the opened "details" row would never close. Upon source inspection, I noticed this comment: "No point in storing the row if using server-side processing since the nParent will be nuked on a re-draw anyway"; which isn't necessarily true. This was determined to be the source of my problem.

Here's my scenario: I am displaying a table full of individuals (name and unchangeable meta-data, generated on the server side) and want to give the end-user the ability to fnOpen() a detail row that shows what permissions an individual has (and allow a change of those permissions). There are many, many permissions so I don't want to waste screen real estate showing them for every individual. The detail row is self-contained; it does not cause a table redraw or anything like that if there are changes made within it.

Is it possible to have an override? Something like:

[code]
this.fnOpen = function( nTr, sHtml, sClass, bServerSideOverride )
{
...
/* No point in storing the row if using server-side processing since the nParent will be
* nuked on a re-draw anyway
*/
if ( bServerSideOverride || !oSettings.oFeatures.bServerSide )
{
...
[/code]

I've tested it and it works for me; but I'm hoping you can provide something official.

Also, the website documentation for fnClose() says it returns void but the code returns an integer.

Thank you!

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi mauftarkie,

    Sounds like an interesting little issue there. Thanks for all the details an investigating it! I'm quite happy to include the fix in the core, but I'd like to understand the problem a little bit further before I do so, if you would be willing to elaborate a little?

    Specifically, the server-side demo with fnOpen/fnClose ( http://datatables.net/examples/server_side/row_details.html ) doesn't really seem to have any problems with hiding old rows. Could you provide a few more details about the situation you are running into please?

    Thanks,
    Allan
  • mauftarkiemauftarkie Posts: 2Questions: 0Answers: 0
    Absolutely; however, with the link you posted (which, for some reason, I hadn't seen before despite poking around for awhile) has a solution that doesn't require a core change. I've tested it and it works. I'm happy enough with that. ;)

    Please consider this a closed request.

    Thank you for everything!
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Sorted :-). Good to hear it works!

    Regards,
    Allan
This discussion has been closed.