Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:45:35+00:00 2026-06-07T03:45:35+00:00

Hi i am using the jquery datatables plugin with the multi_filter_select individual column filtering(work

  • 0

Hi i am using the jquery datatables plugin with the multi_filter_select individual column filtering(work the same as the individual column filtering only they are select boxes).
i have= the first 2 columns hidden and this is causing the filtering boxes to show up under the wrong columns because the first 2 filtering boxes are for the hidden columns pushing everything down 2 columns.

here is my code:

api functions for individual filtering

(function($) {
/*
 * Function: fnGetColumnData
 * Purpose:  Return an array of table values from a particular column.
 * Returns:  array string: 1d data array
 * Inputs:   object:oSettings - dataTable settings object. This is always the last argument past to the function
 *           int:iColumn - the id of the column to extract the data from
 *           bool:bUnique - optional - if set to false duplicated values are not filtered out
 *           bool:bFiltered - optional - if set to false all the table data is used (not only the filtered)
 *           bool:bIgnoreEmpty - optional - if set to false empty values are not filtered from the result array
 * Author:   Benedikt Forchhammer <b.forchhammer@mind2.de>
 */
$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) {
        // check that we have a column id
       // alert(iColumn);
       // alert(oSettings);
        if ( typeof iColumn == "undefined" ) return new Array();

        // by default we only wany unique data
        if ( typeof bUnique == "undefined" ) bUnique = true;

        // by default we do want to only look at filtered data
        if ( typeof bFiltered == "undefined" ) bFiltered = true;

        // by default we do not wany to include empty values
        if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true;

        // list of rows which we're going to loop through
        var aiRows;
        // use only filtered rows
        if (bFiltered == true) aiRows = oSettings.aiDisplay;
        // use all rows
        else aiRows = oSettings.aiDisplayMaster; // all row numbers
        //alert(aiRows);
        // set up data array   
        var asResultData = new Array();

        for (var i=0,c=aiRows.length; i<c; i++) {
       // alert("inloop");
                iRow = aiRows[i];
                var aData = this.fnGetData(iRow);
                var sValue = aData[iColumn];

                // ignore empty values?
                if (bIgnoreEmpty == true && sValue.length == 0) continue;

                // ignore unique values?
                else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue;

                // else push the value onto the result data array
                else asResultData.push(sValue);
        }

        return asResultData;

}}(jQuery));


function fnCreateSelect( aData )
{
    var r='<select><option value=""></option>', i, iLen=aData.length;
    for ( i=0 ; i<iLen ; i++ )
    {
        r += '<option value="'+aData[i]+'">'+aData[i]+'</option>';
    }
    return r+'</select>';
}

here is the document ready:

$(document).ready(function() {

var customerId = $("#customer").text();

    var fleetT = $('#fleetsTable').dataTable( {
        "bProcessing": true,
        "bServerSide": false,
        "sAjaxSource": "/fleet_processing.php",
        "aoColumns": [{"bVisible":false},{"bVisible":false},null,null,null,null,null],
         "fnInitComplete": function() {
                $("tfoot th").each( function ( i ) {
                    this.innerHTML = fnCreateSelect( fleetT.fnGetColumnData(i) );
                    $('select', this).change( function () {
                     //var realIndex = fleetT.oApi._fnVisibleToColumnIndex( fleetT.fnSettings(), jQuery('tfoot select').index(this));
                    fleetT.fnFilter( $(this).val(), i);
                } );
            } );
         }
    } );

and the html:

<table cellpadding="0" cellspacing="0" border="0" class="display" id="fleetsTable">
    <thead>
        <tr>
            <th width="20%">fleet id</th>
            <th width="20%">customer id</th>
            <th width="20%">Equipo</th>
            <th width="25%">Marca y Modelo</th>
            <th width="25%">Filter Type</th>
            <th width="15%">Model Number</th>
            <th width="15%">quantity</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="5" class="dataTables_empty">Loading data from server</td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <th>fleet id</th>
            <th>customer id</th>
            <th>Equipo</th>
            <th>Marca y Modelo</th>
            <th>Filter Type</th>
            <th>Model Number</th>
            <th>quantity</th>
        </tr>
    </tfoot>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:45:36+00:00Added an answer on June 7, 2026 at 3:45 am

    This is a hack, but you could manually tell the correct index to fnGetColumnData()

    this.innerHTML = fnCreateSelect(table.fnGetColumnData(i + 2));
    

    http://jsfiddle.net/nicolapeluchetti/Yvpr5/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jQuery DataTables plugin to do filtering on a set of
I have started using the DataTables plugin (v1.6.2) for jQuery (v1.4.2), and I would
I have been using the DataTables plugin for jQuery (http://www.datatables.net) to search, sort and
So I am using the JQuery DataTables plugin, and have configured it to use
I have been looking for some examples and solutions using the jquery-datatables-editable plugin and
I'm using Datatables and have this jquery plugin showing in a few columns http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
I am using the jQuery DataTables plugin. I would like to move the search
I am using the jquery plugin datatables and am trying to take advantage of
I'm using the latest version of the jquery plugin DataTables and I tried to
I am using JQuery with the DataTable plugin, and now I have a big

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.