Welcome Guest, Not a member yet? Register   Sign In
Ajax
#2

[eluser]gon[/eluser]
Steps are:

* getting the date from the datePicker.
* making an AJAX request, passing the date as an argument. you should be using a javascript library that will do things be easier. jQuery is very easy to learn and use. The URL will be one of your controllers, and the arguments the same as if you didn't use AJAX (URI segments or POST params).
* make the controller gets the data from DB, and render the view as usual. It won't be rendered in the browser, but sent to the AJAX call. Of course, the only thing that must be rendered is the data to be shown inside the table.
* when receiving the data from the AJAX call, replace the table HTML using innerHTML, or using DOM (which is harder of course). And, if neccesary, set events on the new content for doing actions.

Remember that AJAX doesn't neccesarily involves changing the CI part.

And use firebug to know what's happening. you can debug AJAX calls and answers.

cheers.


Messages In This Thread
Ajax - by El Forum - 04-11-2008, 06:57 AM
Ajax - by El Forum - 04-11-2008, 07:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB