0

Filter rows in DataTables as follows:

$.fn.dataTableExt.afnFiltering.push(
    function( oSettings, aData, iDataIndex ) {
        if ( aData[3] == 'ru' )
        {
            return true;
        }
        return false;
    }
);

And here is how to filter the columns? For example I have columns ( http://jsfiddle.net/JLvWu/ ):

Date   |      City1      |      City2      |      City3        |
       | Revenue | Costs | Revenue | Costs | Revenue | Costs   |

How to make so that when you filter by city there was only one city that is selected, and all other columns disappear? For example, if the user selected in the cities-filter City1, the table must be changed as follows:

Date   |      City1      |
       | Revenue | Costs |

1 Answer 1

1

There is datatables documentation, which show how to hide/show columns dynamically: http://www.datatables.net/examples/api/show_hide.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.