How can I implement a sorting dropdown for a Responsive jquery footable?

I would like to sort by First name, Job title and DOB using a dropdown (html select) for the following table:
http://fooplugins.com/footable-lite-demos/demo-sorting.htm
Note: Basically what is required the jquery onchange code.
$('#mySelect').on('change', function(){
		//Code goes here.
}
);

Open in new window

LVL 37
Miguel OzSoftware EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Do you want to be able to do a sort by multiple columns or do you want to replicate the current column header click for sorting?

The table already sorts on column click - what does the select add?
0
Miguel OzSoftware EngineerAuthor Commented:
Just one column (It is dropdown thus only one selection is made) this is an independent sort select when my page goes to mobile view.
0
Julian HansenCommented:
Ok I am confused. You already have sorting by column by clicking on the column header - what is the rationale for adding a select to do the same thing?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Miguel OzSoftware EngineerAuthor Commented:
It is a business request for mobile view and it is required. Question could be rephrased as how can I sort at run time using jquery not the UI?  ( Select is just a means to an end)
0
Julian HansenCommented:
Probably the easiest is to just trigger a click on the column you want to target

$('th:eq(2)')[0].click();

Open in new window

Or
$('th:eq(2)').trigger('click');

Open in new window


There is a hidden column in your table (Last Name) you have to take this into account for the column count.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
If you want to be a bit more accurate you can give your <th> a class (say FirstName) and then trigger it on the class
$('th.FirstName')[0].click();

Open in new window

0
Miguel OzSoftware EngineerAuthor Commented:
Thanks
0
Julian HansenCommented:
You are welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.