How to sort multiple tables at the same time in a cF page.
For example when the user sort first table then it has to automatically sort other tables according to first one in that page...
ColdFusion LanguageJavaScript
Last Comment
new_perl_user
8/22/2022 - Mon
erikTsomik
Are you talking about html tables on the page
new_perl_user
ASKER
Yes....
leakim971
1 - create a sort function for each table
2 - each sort function use a key
3 - for the "other" table the key come from the first table
4 - for the first table the key is the order (desc or asc)
5 - each time you sort the first one, you call the sort function of the other table
function sort(table_to_sort, key) {
// sort code
}
Your help has saved me hundreds of hours of internet surfing.
fblack61
new_perl_user
ASKER
I am a newbie to CF, if possible can u pls give me a code snippet..
Right now we have a function called sort and we are calling this sort function at both the tables as below:
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
new_perl_user
ASKER
we have tried tablesorter but it did not work for multi-table sorting...
Can you let me know how it works..
new_perl_user
ASKER
Can anyone please help me on this...
When a user is sorting table1 column1 ascending and when he is revisiting the page it is changing both the tables to desc..
But for desc it is working fine...
Do I need to tweak anything here
function sort (b_0,b_1)
{ var current_col = this.document.getElementById("b0").value;