Forum


List Manager Support

List Manager support
Forums
Public write access is disabled. Please login

Conditionally show the "details" button 09.06.2015 19:22

Hi everyone,
on my project I have lists with records that can have a (html) "description" field filled or not.
I need to show the "details" button only on rows where the description exists.
I'm trying to edit javascript so that it checks when the field is empty before adding the "imgdetail" icon (listmanager.js, line 1058), but this has turned out to be quite difficult as all data is loaded and restructured dynamically, using lots of functions and very obscure design patterns.
Honestly, I despise the huge amount of JS this component uses, it's excessive, heavy and hard to customise!

Any hints on where to get data from the row while adding the buttons?

Re: Conditionally show the 'details' button 09.06.2015 19:47

Ahh, done I was close!
I've added some lines in listmanager.js:405

var hasDetail = false;
for(var h=0; h var html_value = this.getRow(i).getData(header.id).getValue();
if ( html_value !== "")
hasDetail = true;
}

and a check at line 576:
if (this.acl.isDetail() && hasDetail) {"

PS: apparently I can't insert code here, the line I needed was this:
this.getRow(i).getData(header.id).getValue();

Edited by Scotolati - 09.06.2015 19:50

Re: Conditionally show the 'details' button 10.06.2015 08:41

Hi,

Great!, your solution is right, thanks for sharing. The extension follows joomla mvc pattern, and for the frontend it does such a huge amount of dynamic functions that js is required, with a lot of custom classes and even code patterns (observers, etc...), so we'd prefer to say is complex.

Regards,
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback