close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Using the sort in Data Assist, how do I make an icon to show the sort status?

Thread began 4/14/2009 7:29 am by RichGags | Last modified 4/14/2009 12:36 pm by Ray Borduin | 3892 views | 9 replies |

RichGags

Using the sort in Data Assist, how do I make an icon to show the sort status?

I need to create a sortable spreadsheet. I was successful in setting up the spreadsheet with the Data Assist wizard and added sorting with a link at the top of each column. The link is the column header itself. Everything is working except I would like to show an arrow icon next to whatever column heading is sorted. (An up arrow or down arrow depending if ascending or descending).

How would I do this?

Thanks!
Rich

Sign in to reply to this post

Ray BorduinWebAssist

You would have to add the images and create an IF statment by hand to show the correct arrow based on the sort value. Since this is not a directly supported feature it would require knowledge of the server language you are using and a small amount of hand code.

Sign in to reply to this post
Did this help? Tips are appreciated...

RichGags

Ok. I think I can handle that. Can you point me in the right direction with the if statement? Or do you know where I can find a tutorial on it? I tried Googling it but I couldnt find one.

Thanks!

Sign in to reply to this post

Ray BorduinWebAssist

What is your server language? Look at the code on top of the page where it is set. You will see that the sort is stored in a session variable. Your if statement would check the value of that variable.

Sign in to reply to this post
Did this help? Tips are appreciated...

RichGags

Server language? I thought that was PHP?

Can you help me find the variable and pull in the right img depending on the sort? Ive set it up right now for simplicity with just one header sort (city). Ive attached my php page.

If the sort = city and ascending, it should show up.gif next to the column heading city.

Thanks!

Attached Files
php.txt
Sign in to reply to this post

Ray BorduinWebAssist

your if statement would be something like:

<?php
if (isset($_SESSION["WADA_OrderClause_users_Results"]) && $_SESSION["WADA_OrderClause_users_Results"] == "city") {
?>
image here
<?php
}
?>

Sign in to reply to this post
Did this help? Tips are appreciated...

RichGags

So I would use what you wrote in the column header like this?

<th class="WADAResultsTableHeader"><a href="users_Results.php?sort=city">city:</a>
<?php
if (isset($_SESSION["WADA_OrderClause_users_Results"]) && $_SESSION["WADA_OrderClause_users_Results"] == "city") {
?>
<img src="up.gif">
<?php
}
?>
</th>

Sign in to reply to this post

Ray BorduinWebAssist

That is my best guess. Writing php usually entails debugging php by hand, so if it doesn't work, write the value of the session variable to the page, maybe it has a different value than you expect.

Sign in to reply to this post
Did this help? Tips are appreciated...

RichGags

Thanks so much. One more thing, how do I write the session variable to the page?

Sign in to reply to this post

Ray BorduinWebAssist

echo();

or

print();

so something like:
<?php echo($_SESSION["WADA_OrderClause_users_Results"]); ?>


see www.php.net for general php information such as this. They have extensive information on php and its functionality.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...