Feature: semi-dynamic options

Feature: semi-dynamic options

jlundelljlundell Posts: 8Questions: 0Answers: 0
edited February 2010 in General
OK, that's maybe a misleading topic, but....

1. It'd be nice if aoColumns didn't have to have exactly the right number of columns, but rather assume null for missing columns.

2. I'm using some DOM tables that start out empty, and get rows added (statically from datatables' pov), so the tables can have 0, 1, 2... rows. When there are very few rows, it doesn't make sense to have sort/filter controls, so on the server side I'm setting bSort, bFilter, based on the number of rows. It'd be more convenient if I could (for instance) set bSort = 3, and then have the sorting controls only if the number of rows is >= 3. Similarly for bFilter, bPaginate, maybe some others that I'm not using.

Or, if the b in bSort means 'boolean', then nSort instead.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi jlundell,

    1. 110% agree. I hope to address this in a future revision in the not two distance future :-)

    2. What you could do is use fnDrawCallback to check how many rows are on display (or if pagination is needed etc) and show/hide the table controls based on that information. This has worked successfully for others who have implemented this (although I don't have any code samples to hand - sorry).

    Allan
  • jlundelljlundell Posts: 8Questions: 0Answers: 0
    Thanks. For my purposes, I've encapsulated all my datatables logic in a Python class on the server side, so I can calculate the right (static) parameters there--my tables don't change size on the client. I'll look at fnDrawCallback, though, since it may simplify matters. Still, I think that making the original parameters thresholds rather than (just) flags would be a convenient (and natural) extension.
This discussion has been closed.