• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Dynamic data display on list view (not module).

m6xmed5

Member
I have been looking around the forums to see if it's possible to have the data display dynamically, so as someone submits or edits a form the list view updates for everyone viewing it without a page refresh.

I read that we can do an ajax refresh as long as ajax is turned on in the list options.

So I created a file in components/com_fabrik/js called list78.js with the following code in it.


JavaScript:
requirejs(['fab/fabrik'], function () {
       Fabrik.addEvent('fabrik.list.submit.ajax.complete', function(list, data) {


           function updateList78() {
                if (Fabrik.blocks.list_78) {
                Fabrik.blocks.list_78.submit();
    }
}
var interval = setInterval(updateList78, 10000);

  
});
});

I have also set mediabox instead of slimbox on the global js options.
It does nothing, anyone any ideas what I'm doing wrong? I'm know the list78.js file is included because one of the times I was messing about with the addEvent it threw an error referencing that file.

Any help is much appreciated.

Marc
 
Well, your update will only run on a fabrik.list.submit.ajax.complete. That second line says "run my code when the fabrik.list.submit.ajax.complete is fired. Which gets fired after someone does something that causes an AJAX refresh (navigation, filtering, etc).

If you just want to reload every 10 seconds

Code:
requirejs(['fab/fabrik'],function(){
   Fabrik.addEvent('fabrik.list.loaded', function(list) {
      list.updateRows.periodical(10000, list);
   });
});

... which waits till your list is loaded, then adds a periodical to fire the updateRows() method for that list every 10 seconds.

if you have more than one list on the page, you'd need to add a check to make sure you only add the periodical for the right list ID.

-- hugh
 
We are in need of some funding.
More details.

Thank you.
Back
Top