FixedHeader collide with DataTables Column Filter

FixedHeader collide with DataTables Column Filter

slanoslano Posts: 3Questions: 0Answers: 0
edited August 2012 in FixedHeader
Hi,

FixedHeader plugin is colliding with DataTables Column Filter plugin (http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html), when Column Filter is placed in the thead section of the DataTables table. Everytime there is some action on the filter fields (input into input element, or select on the selectbox), filtering on the table is being performed, but immediately, _fnCloneThead is called, replacing the FixedHeader thead with the default one, loosing the data in input/select boxes.

I tried modifying the function _fnCloneThead to only perfom cloning once (if nTable.childNodes.length = 0) which makes the filtering working properly, but when sorting the table the class of is not changed (it's changed only on the original thead which is hidden, not on the thead cloned by FixedHeader), therefore the sorting arrows are not displayed/refreshed properly.

Is there any way to modify FixedHeader to insert the actual status of input/select boxes from thead when performing a clone?

I can create a simple example and upload it somewhere when the description is unclear. Thanks for any help.

Replies

  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    Try using the very latest version of FixedHeader (the nightly from the downloads page). It doesn't clone on every single draw, so it might operate better with plug-ins that manipulate the header.

    Allan
  • slanoslano Posts: 3Questions: 0Answers: 0
    edited August 2012
    Hi Allan, thanks for a hint, 2.1.0.dev worked like a charm! (except new thead is not changing the size with browser window resize.. :| )
  • slanoslano Posts: 3Questions: 0Answers: 0
    hmm, so it looks like that filtering/sorting is causing no problems right now, but the new issue is that the FixedHeader thead is not being resized when changing the browser windows size. Any hint on this one?
  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    It should actually cope with that:

    [code]
    $(window).resize( function () {
    FixedHeader.fnMeasure();
    that._fnUpdateClones.call(that);
    that._fnUpdatePositions.call(that);
    } );
    [/code]

    is in the code. However, that does mean the filtering will be nuked, since the header elements will be cloned again... So back to square 1.

    Have you considered using the y-scrolling feature built into DataTables? I suspect you'll find that much easier to integrate with column filtering.

    Allan
This discussion has been closed.