Giter Club home page Giter Club logo

Comments (11)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
You are right, plugin is not compatible with sScroll settings. I see what is 
happening -  filtering boxes are still in the footer where this addin has 
placed them, but DataTables creates fake header/footer in the separate tables 
and hides original ones where filtering is placed. Therefore it looks like 
there is no filtering at all. You cna see this in the FireBug there are 
separate tables in the schollhead/schrol foot tables.

I will check how this cnabe fixed and is it possible at all because I don't 
know would I have control over the table if I nject filtes in the separate 
table that is used as fake footer.

Original comment by [email protected] on 14 Jun 2011 at 7:24

  • Changed title: Column filter does not work with the sScrollX/sScrollY settings
  • Changed state: Accepted

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Jovan, check if it's possible with latest datatables release esp. on the 
infinite scrolling capability. That's awesome for displaying/simulating rapid 
scrolls of thousands of rows.

Original comment by [email protected] on 14 Jun 2011 at 4:00

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
No, it is still the same problem.
In any verison of the dataTables it creates fake header/footer in the separate 
table and I cannot access it, nor I cannot access the original table data from 
the fake footer.

If you really have scroll bar you will need to create custom filter. I will 
check whether this can be implemented somehow in column filter but currently I 
don't see some easy fix.


Original comment by [email protected] on 14 Jun 2011 at 7:32

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Eventually this solves your problem:

use fnDrawCallback of datatable:

, "fnDrawCallback": function () {

//don't redo if controls already exist; take care, possibly buggy
                    if ($("#table2_wrapper div.dataTables_scrollHeadInner th input").size() > 0)
                        return;

//backup old focus
                    var focusedElementId = $("*:focus").attr("id");

                    //read old input field values
                    var oldInputs = $("#table2_wrapper div.dataTables_scrollHeadInner input");
                    var oldValues = new Array(oldInputs.size());

                    oldInputs.each(function (i, v) {
                        oldValues[i] = $(this).val();
                    });

                    //(re)create column filter
                    $("#table2").dataTable().columnFilter({
                        iFixedLeftColumns: 2,
                        rootElement: "#table2_wrapper div.dataTables_scrollHeadInner ",
                        sPlaceHolder: "head:after",
                        sRangeFormat: "From{from} to {to}",
                        aoColumns:
                            [
                                { type: "text" }
                                , null
                                , { type: "number-range" }
                                , { type: "number-range" }
// ... whatever you like
                            ]
                    });

                    //restore old input field values
                    var newInputs = $("#table2_wrapper div.dataTables_scrollHeadInner input");

                    newInputs.each(function (i, v) {
                        $(this).val(oldValues[i]);
                    });
//give focus back to the input field that had focus before
                    if (focusedElementId != null)
                        $("#" + focusedElementId).focus();

//stop event bubbling for the input controls if sorting is switched on
                    $("#table2_wrapper div.dataTables_scrollHeadInner thead input").click(function (event) { event.stopPropagation(); this.focus(); });
                }


Furthermore, I've attached a slightly customized version of the latest column 
filter plugin. The important change is that you can specify a root element 
which is used as starting point in the DOM to look for the header element (see 
code above for an example).

HTH

Original comment by [email protected] on 4 Jul 2011 at 2:08

Attachments:

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I'm not sure that this is exactly the correct solution, but its certainly part 
of it :-). DataTables holds a reference to the THEAD and TFOOT elements in its 
settings object. These are nThead and nTfoot - these will refer to the correct 
elements for scrolling and non-scrolling tables. Thus what you can do is change 
the line

            $(sFilterRow + " th", oTable).each(function (index) {

to

            var settings = oTable.fnSettings();
            var host = (sFilterRow.indexOf('tfoot')!==-1) ?
                settings.nTfoot :
                settings.nThead;
            $(sFilterRow + " th", host).each(function (index) {

Original comment by [email protected] on 23 Dec 2011 at 10:53

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Hi,

I think that this problem is solved thanks to Allan's example. You can see 
results on 
http://jquery-datatables-column-filter.googlecode.com/svn/trunk/ScrollInfinite.h
tml 

Thanks,
Jovan

Original comment by [email protected] on 13 Feb 2012 at 3:24

  • Changed state: Fixed

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Excellent work. Can you please update this in 
"jquery.dataTables.columnFilter.js" file of the column-filter download 
(http://code.google.com/p/jquery-datatables-column-filter/downloads/list)

Original comment by [email protected] on 17 Feb 2012 at 7:00

Attachments:

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
This seems to be an issue with the latest version, I have added scrolly to an 
existing grid with filters and the filters disappear. 

DataTables 1.9.4 
ColumnFilter 1.0.2 

Also when using these later versions it seems that the sort toggles have moved 
up to the filter row.

Original comment by [email protected] on 10 Feb 2013 at 9:07

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Sorry I meant Column Filter 0.9, 1.0.2 was the release of the nuget package.

Original comment by [email protected] on 10 Feb 2013 at 9:35

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
It seems it is fixed with 1.5.0 but this isn't on the downloads page. you have 
to grab it from the trunk.

Original comment by [email protected] on 10 Feb 2013 at 10:52

from jquery-datatables-column-filter.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I am having a similar problem.

Using Jquery 2.0.3, dataTable 1.9.4 and COlumnFilter 1.0.2.

When adding sScrollX, I see the filters, but when typing in to it, I get a 
Jquery error "unable to get nodetype of undefined or null reference". Is there 
a different version of column filter that I can use ?

Original comment by [email protected] on 8 Oct 2013 at 5:01

from jquery-datatables-column-filter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.