I have some data I am loading into a table for display. I have the table set up with CSS to show a fixed header and allow scrolling through the results in a fixed sized table.
I need to have 3 chained dropdowns which will re-display the data matching the selected criteria. I also have a text box for freetext searching. At the moment I am using prototype to load a script which just outputs the returned data ...
Code: Select all
<body onload="new Ajax.Updater('chartBox', 'includes/ajax/tbl_nmi.php', { method: 'get' });">My problem comes with the chained selects (and I have already read the tutorial thread on this). I understand the concept, but what I'm wondering is what is the best way to return that html output, alongside the new data for the dropdowns?
Should I make a second ajax call? Seems a waste as the data is already being loaded for the table .... it's mean another load for the db-wrapper and a requery.
Or maybe I should not use the Ajax.Updater and go for the more complex method. This is my first time out with AJAX so I'm not sure there is a way to do this. I thought maybe XML or JSON and just sending the table in that. I dont know if this is barking up the wrong tree or not.
Any advice here guys? Thanks