Using jQuery to filter a table from multiple select elements?

This is pretty simple to do using multiple classes (I usually call them markers when they're not being used for styles. ).

This is pretty simple to do using multiple classes (I usually call them markers when they're not being used for styles. ) Report Number Date Name Trainer Status 12345-1 05/01/2011 First Recruit First Trainer Complete 12345-2 05/02/2011 First Recruit Second Trainer In Progress 54321-1 05/03/2011 Second Recruit First Trainer Created Then anytime you want to filter just concatenate all the corresponding markers with periods for example: $(". Obj_row_item").hide(); $(".

Obj_first_recruit. Obj_second_trainer. Obj_in_progress").show(); For simplicity's sake you can make the values of the dropdowns correspond to the marker names making your statement look something like: $("." + $("#dropdown1").val() + ".

" + $("#dropdown2").val() + ". " + $("#dropdown3").val()).show().

I didn't even think about that. Sometimes the simplest answers are the best. I do have to account for multiple options in each select element.Is there an easy way to do that without using 3 $.

Each statements? – Greg Stiffler May 10 at 23:28 Ah I didn't notice you were using selects. Since all items are hidden at first I would just create a three level loop that iterates through the selections and concatenates each combination and calls show for each one if that makes sense.

Just create a variable for each level containing the current iteration of the selected items and then alter the concatenation line I wrote above to use the variables instead of the vals. – Spencer Ruport May 11 at 0:07 Thanks for your help! The loops ended up being more complicated because of possible user input.

They can select a couple from the first input, nothing from the second and maybe a few from the third for instance. I edited my question with what I came up with. I doubt it's even close to the most efficient way of doing that, but it works.

Thanks! – Greg Stiffler May 11 at 1:42.

Take a look at the jQuery Datatables plug-in. It makes manipulating an HTML table a snap. With some simple setting changes, you can easily do what you're looking for (and more.) Make sure to check out the example on filtering using select elements.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions