Can I reload part of a page? [Solved]

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
rupertcutler
New Member
New Member
Posts: 5
Joined: Tue Jun 03, 2014 9:27 am

Can I reload part of a page? [Solved]

Post 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
Last edited by rupertcutler on Mon Dec 15, 2014 10:06 am, edited 1 time in total.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Can I reload part of a page?

Post 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.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
rupertcutler
New Member
New Member
Posts: 5
Joined: Tue Jun 03, 2014 9:27 am

Re: Can I reload part of a page?

Post by rupertcutler »

Many thanks for the pointers - looks just what I need :)

R
Post Reply

Return to “The Lounge”