Code Monkey home page Code Monkey logo

Comments (2)

Holt59 avatar Holt59 commented on August 19, 2024

This is possible, what you want to do is something like:

filters: {
    _1: function (data, text) {
        for (var i = 0; i < data.length; ++i) {
            // text is always uppercase, you can obviously perform different checks.
            if (new String(data[i]).toUpperCase().indexOf(text) !== -1) {
                return true;
            }
        }
        return false;
    }    
}

The _1 key is what you want here for the lambda, this should give you an input filter on the first column. The easiest way if you want to move it / make it span multiple column is to do it after the datatable via JS. data will contains the whole row, which in your case is a standard JS array.

I cannot test this code right now, so it may not work out-of-the-box, but you get the idea! Feel free to ask if you need more information.

from datatable.

Thornore avatar Thornore commented on August 19, 2024

Thank you very much for your reply and solution. I did, however, write my own search function in the meantime that iterates the entire data array, re-assigns it to the table's data array, refreshes the table, and then resets the per page option. It seems to work fine...

from datatable.

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.