Individual Colum Filter

Individual Colum Filter

rasikowrasikow Posts: 20Questions: 0Answers: 0
edited June 2009 in General
Hi,

I have 5 columns in table. i want to display the Individual Filter text box for certain columns only.
For example, I want to display Column-1 and Column-4 for Filter. Other columns should not display Filter Text box
how to resolve it?

Thanks in advance

- Gnaniyar Zubair

Replies

  • RobRob Posts: 17Questions: 0Answers: 0
    edited June 2009
    Comment out, hide or delete the field code for columns you don't want to filter by. Note: If using the default CSS, you may need to add a character (e.g., non-breaking space) in order to maintain the footer border.

    [code]

    <!-- -->
    <!-- -->

    <!-- -->
    [/code]
  • rasikowrasikow Posts: 20Questions: 0Answers: 0
    Thanks Rob. I will try it

    - Gnaniyar Zubair
  • rasikowrasikow Posts: 20Questions: 0Answers: 0
    Hi Rob,

    i commented out as you said like this:




    -All-Trident


    <!-- -->


    <!----!




    Those Commented text boxed are not showing But vesselName is filtering for client, status is searching for QuoteId.

    Filtering is not happening properly. second field is filtering for first...third fields is filtering for second...etc...
    how to resolve it?

    I want filter box for particular columns only. Also First column should be select box instead of Text box. if i select, "All" from that select box, it should select all .

    How to do this? please clarify.

    -Gnaniyar Zubair
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I presume that you are using this line from the demo:

    [code]
    oTable.fnFilter( this.value, $("tfoot input").index(this) )
    [/code]
    which will be the one that is causing you problems. As you can see the column which is being filtered on (the second parameter passed to fnFilter) is the index of the input element which is currently being used, compared to the other inputs.

    However that indexing is all messed up now since you have removed some of the input boxes - hence why it is search on the wrong columns for you.

    There are a number of options for how to fix this - entirely up to you how you do it - here are a few of them:

    1. Apply the keyup event to each input box individually and tell it specifically which column should be used
    2. Use the input elements parent node (ie the td element) as the index rather than the input element itself. I prefer this option.

    Regards,
    Allan
  • bakaynbakayn Posts: 14Questions: 0Answers: 0
    how filter and sort on head table?
This discussion has been closed.