• 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.

Using list div template with ajax nav no longer display anything after filtering up to an empty list

lcollong

FabriKant d'applications web
Hi,

Pretty easy to simulate. Including on the back-end using regular isis template. Tested on a recently updated site. My test case :
list set with ajax nav, filter above, on change, layout (admin) --> div
2 additional regular elements with filter (dropdown) set.
Filling in 2 records with different data.
Displaying the list in the back-end
filtering once --> 1 record
filtering twice in order to be sure to not find any data -> no records shown.

1/ the empty data message 'no records' does not show up
2/ you cannot revert to display any data (clear filters) until you refresh the whole page.

Does not occur with the standard bootstrap template.

It seems that list.js remove the main fabrikContainer and no longer draw it back for the next fetch ?...

Thanks for testing and confirm
 
I have the second problem too - you cannot revert to display any data (clear filters) until you refresh the whole page, but in frontend view with standard protostar template.
 
Hmm, I can see this, too.
But it's in frontend AND backend.
And it's also with the bootstrap template if Fabrik list caching is not disabled (in list settings, Joomla caching is OFF anyway).
 
NEEDS TESTING!

OK, I resolved the OP problem, but that raised another problem, which required a bit of a hacky solution.

The first problem was that the "empty row template" was not being handled properly in the JS. That's the blank row we generate in the list view and pass to the list JS as an option, for use with AJAX enabled lists, either when the list loads with no rows (like with "required filters"), or after AJAX filtering empties out all the rows. Because the AJAX filter response is just a JSON array of element data, not a rendered row template, we need that blank template to insert the individual element data into.

But that then uncovered another problem, which is that div templates have that extra row wrapper ... ie. they have multiple list data "rows" (using a Bootstrap grid) per rendered view "row", rather than the simple "one row of rendered data per table row" in the standard template. And as we generate the "empty row template" from the template's default_row.php, that extra grid wrapper was not there ... in the div template, it's handled in default.php, after we've iterated round and built an array of all the row templates with default_row.php.

So I had to add an extra template file to the div template folder, 'default_empty_row.php', which generates the single empty default_row template, then wraps that in the Bootstrap grid. Then removes the outer 'row-fluid' div that our Html::grid() helper wraps grids in. So when generating the empty row template, the view code now checks to see if default_empty_row.php exists, and if so uses that instead of default_row.php.

I'm about to commit the changes, would appreciate some testing for both div and non-div templates, on front and back end, with and without AJAX.

-- hugh
 
Sounds clear. It's a bit late now, here in south of France but I'll check it tomorrow :)
Thanks
 
Out of interest, did this ever work for div templates? I'm struggling to see how it could ever have worked, with AJAX enabled, with a div template, once the list was empty.

Hugh
 
On the front end it works like a charm (which, indeed, was the main issue). However the "empty table" message does not show.
On the back end, it shows back values without any templating after clearing filters following a 0 rows result.

Out of interest, did this ever work for div templates? I'm struggling to see how it could ever have worked, with AJAX enabled, with a div template, once the list was empty.
I've only used the div template on few sites and not recently until the current site I'm working on. As far as I remember, only used "div" template in non-ajax mode. And if so, never noticed the problem before. So could not say.
 

Attachments

  • filtered.PNG
    filtered.PNG
    19.2 KB · Views: 157
  • no records.PNG
    no records.PNG
    14.6 KB · Views: 155
  • on first load.PNG
    on first load.PNG
    22.5 KB · Views: 161
  • after clear filters.PNG
    after clear filters.PNG
    23.1 KB · Views: 139
Old IE11 is still running flash (I think; maybe I had it enabled there some time ago just for testing);)
@startpoint : Did you clear all browser cache?
Clearing filter is working in frontend and backend on my site.
"No data" is still missing.

But I have a strange behaviour with "show labels"=yes ( not related to the last commits, it's also with older ones):
The labels are showing shortly, then they are overridden with the element content.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top