Welcome Guest, Not a member yet? Register   Sign In
how do I show popup list on hover?
#1

[eluser]Frank Rocco[/eluser]
Hello,

I want to query mysql and show a list of detail (related)records when a user hovers the mouse over the master record.

Anyone have an example?

Thanks

Frank
#2

[eluser]CroNiX[/eluser]
Sure, in your table where you are displaying the main records, add the id of the record as the id of that table row.
So its like
<tr id="id_32"><td> </td> ... </tr>

Where "32" is the id of your record.

Then use jquery to detect the id of the row that the mouse is hovering (probably on a 1 second delay...so you have to hover for 1 second before it sends the request) and send that id using ajax to your controller, where it will query the database based on that id and get the lower level data you want, and send the results back using JSON. Use the JSON result to create a "tooltip" that displays all of the retrieved data.

Its fairly straightforward if you check out jquery and ajax. I don't have specific code to show you right now, but that will point you in the right direction hopefully.
#3

[eluser]Frank Rocco[/eluser]
Thanks for the reply, I will see if I can find it. If you or someone can find a small example, that would be great.

Regards,

Frank




Theme © iAndrew 2016 - Forum software by © MyBB