Hide tds with empty (null) values in db

verzevoul

Member
Hi!
I searched a lot on the forum but I couldn t make it.
I need to hide tds (reduce them) from my list view if they are empty. See attachment.

I want to do this because when I print in pdf my list is too large.
Is there a way?
I use the latest update. 3.1rc2 November 2013
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    283.2 KB · Views: 395
hi -this would require some custom js code to achieve what you are after.
If you point me at the page by filling in your site details here - http://fabrikar.com/you/my-sites/ then I can suggest some js.
The code would be to hide the entire column if every rows cell data was "0.00" - is that correct?
-Rob
 
Please tell me another one., related to this site.
You ll see ...index.php?option=com_fabrik&view=list&listid=2&Itemid=146
in the first column '?? ????????????' there is '2 23' in the first row. But in the formview its '??? 235' the correct one. For some reason my calc element gives different behaviour in the form view and differnt in the list view. In the list view it shows the value of the 1 field and in the form view the name (the correct one).

Thanks!
 
create a custom javascript file (http://fabrikar.com/forums/index.php?wiki/javascript/) to load on the list view with this content :
JavaScript:
requirejs(['fab/fabrik'], function () {
// Add in all the full element names you want to hide
var fields = ['1_repeat_tziros___amoibesprosopikou', '1_repeat_tziros___eisagoges'];
var, cols, found;
Array.each(fields, function (field) {
    cols = document.getElements('.' + field);
    found = false;
    cols.each(function (col, x) {
        if (col.get('tag') === 'td') {
            if (col.get('text').trim() !== '0.00') {
                found = true;
            }
        }
    });
    if (!found) {
    cols.hide();
    }
});
});
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top