Page 1 of 1

Can I reload part of a page? [Solved]

Posted: Fri Dec 12, 2014 8:15 pm
by rupertcutler
Firstly I hope this the right place to ask, apologies in advance if not - please tell me where to go! I'm pretty new to CMSMS.

CMSMS 1.11.11
Ubuntu
MySQL 5.5.40

I have a page with a CSS/Javascript 'carousel' (http://desandro.github.io/3dtransforms/ ... ousel.html) - essentially displays a series of panels, moving between them as required.

MySQL contains data that updates in real time and the panels are designed to display data summaries that change as time goes on. The data is obtained by SELECT from MySQL and formatted by a smarty template in a module I've written. So each panel has something like this

{ModuleName action="rep1" reportid="1"} - calls report 1 (template) for report/search 1, returning the results in a <table>...</table>. A different version, reporting different data, for each panel.

On first opening the page each panel of the carousel is populated with data in the usual way, calling the module for each panel.

I'd like to reload each panel, ie refresh the {} module output, between each 'move', something like:

Show panel 1
Refresh panel 2
Show panel 2
Refresh panel 3
etc...

Is it possible to refresh the {} module output without redrawing the whole page?

Perhaps there's a better way to get the data than the module approach?

All help/hint appreciated, thank you

Rupert

Re: Can I reload part of a page?

Posted: Fri Dec 12, 2014 9:35 pm
by Jo Morg
rupertcutler wrote:Is it possible to refresh the {} module output without redrawing the whole page?
You just have to AJAXify a module action.
It should be relatively simple to do so, you can do that with virtually any module. Search the forum for AJAX and you'll see samples of methods of doing it.

Re: Can I reload part of a page?

Posted: Sat Dec 13, 2014 6:07 pm
by chandra

Re: Can I reload part of a page?

Posted: Mon Dec 15, 2014 10:05 am
by rupertcutler
Many thanks for the pointers - looks just what I need :)

R