Dazvolt
Dazvolt

Reputation: 697

Search value in div

I've got a little function which allows to search values through rows, but there is a problem with it - search function is not working properly.

Please take a look at the fiddle here http://jsfiddle.net/4f3WF/

Try to set text in input to "798" for example.

In the end this function must be able to search through entire row, not just only first or last ms-column div. I just don't get what's wrong.

Upvotes: 0

Views: 83

Answers (1)

hsz
hsz

Reputation: 152206

Just try with:

e.find('.multiple-selector-table .ms-search-label .ms-search').on("keyup", function() {
    var value = $(this).val();
    e.find('.multiple-selector-table-row').hide();
    e.find('.ms-column:contains("' + value + '")').parents('.multiple-selector-table-row').show();
});

Updated fiddle

In the first step, we hide all rows. Next we search for cells that contain value passed in input and show their parent rows.

Upvotes: 2

Related Questions