the Delete button does not work when into the div template

enzo2016

Member
Please can you confirm that the Delete button (the button next to the Edit button) does not work when used in the div template? When I try to delete my records and click on it (appearing as dropdown), it returns the message "Select the rows to delete". It works ok for the bootstrap template.

Thanks,
Enzo
 
I made different tests and the div template is not the cause of the Delete button not working. The cause is a setting of default.php:
Code:
Show empty data
$this->showEmpty = false;
When the empty data is set to false, the Delete button does not work because after cliclcking on it, the following message appears: "Select the rows to delete". This message does not appear when the empty data is set to true.
That situation occurs for a copy of the div template.
 
Confirmed.
showEmpty = false is also skipping the (hidden) checkbox needed for the delete.

Modify default_row.php, line 21
if (isset($this->showEmpty) && $this->showEmpty === false && trim(strip_tags($d)) == '' && $heading != 'fabrik_select') :
 
I meant to respond to your initial post when I first read it - because I am using a DIV template and am able to delete 'rows' just fine.

It looks like you found the situation that causes the problem.

On a whim... In the List configuration, under the 'Links' tab, try checking the 'Hide checkbox' option. I'll bet that will prevent the list from behaving this way.

I see Troester replied while I was replying too. So uhmmm, take your pick.:D
 
Thanks to everybody.
I have replaced line 21 and now the Delete button works ok.
The problem is that the template loose its css properties: for example if the template had two columns, then some elements with bold, underline or italic style, after updating the default_row.php the new template will loose bold, underline, double column, etc.
 
I'm pretty sure that Troester left off a matching doublequote at the end. That line should be...

if (isset($this->showEmpty) && $this->showEmpty === false && trim(strip_tags($d)) == '' && $heading != 'fabrik_select' ") :

But I'm telling you , if you had just checked the 'Hide checkbox' option in the list configuration this problem will go away. I use a DIV list and can delete rows with no problems - because when that option is checked, the code that goes checking for "rows to delete" doesn't even get run. It knows what row to delete because you removed the checkbox option - and it knows to just delete that one.
 
@Bauer
I'm pretty sure that Troester left off a matching doublequote at the end. That line should be...
no, this is not a doublequote but two single quotes
(saying if trim(strip_tags($d)) is empty...)

I tried your hint with "hide checkbox", it's not working on my site (if showEmpty = false in the div template).

@enzo2016
I can't imagine how skipping or not skipping the checkbox should do something with your CSS.
How/where do you set the CSS?
 
I am applying the CSS refering to the multiple columns into the custom_css file; the CSS about bold, underlined, italic, etc. into the tab CSS of the correspondent element.


I have checked the Hide checkbox option.
 
@Bauer
no, this is not a doublequote but two single quotes
(saying if trim(strip_tags($d)) is empty...)
Duhh - I couldn't figure that line out 'til you explained the double single quote. I'm sick and not quite all there - can I use that as an excuse?:p

I'm still baffled as to why all (my) DIV templates don't have this problem. Though mine is a 2-year old cloned DIV template with some changes to make the DIVs show in a fluid layout as the screen is resized. So maybe it's something that was added or changed since then.
 
I am attaching my default_row file because maybe it is slightly different because I changed line 19 not 21:
Code:
<?php
/**
* Fabrik List Template: Div Row
* Note the div cell container is now generated in the default template
* in FabrikHelperHTML::bootstrapGrid();
*
* @package     Joomla
* @subpackage  Fabrik
* @copyright   Copyright (C) 2005-2016  Media A-Team, Inc. - All rights reserved.
* @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
*/

// No direct access
defined('_JEXEC') or die('Restricted access');

?>
<?php foreach ($this->headings as $heading => $label) :
    $d = @$this->_row->data->$heading;
    if (isset($this->showEmpty) && $this->showEmpty === false && trim(strip_tags($d)) == '' && $heading != 'fabrik_select') :
        continue;
    endif; ?>
    <div class="row-fluid <?php echo $this->cellClass[$heading]['class'] ?>">
        <?php if (isset($this->showLabels) && $this->showLabels) :
            echo '<span class="muted">' . $label . ': </span>';
        endif; ?>

        <?php echo $d ?>
    </div>
    <?php
endforeach;
?>

Please could you check it?
 
I can't say how many times I've encouraged the removal of the use of @ whenever possible because they do throw errors when in 'development' mode. IMO that's just lazy programming. And if it doesn't throw an error, then you are not even aware of the failure of the 'if' condition because the $d in that next line is never initialized properly.

That's why I always change this line in my list div template...
PHP:
    $d = @$this->_row->data->$heading;
to...
PHP:
   $d = isset($this->_row->data->$heading) ? $this->_row->data->$heading : '';

My batting average is pretty low in this thread - but I'll go out on a limb here and say this is what's going on with you. If '$this->_row->data->$heading' is not set, then the 'if...' fails and the continue is never done.

If so, I now have another reason to push that line be changed at Github. :rolleyes:
 
Bauer thanks for the attempt made and for your used language because it helps me to improve my English. Unfortunately the css weren't restored, so for the moment I have replaced the file with the original default_row.php with the problem to the Delete button.
I don't know if it could be useful: I am using some copies of the div template where the content is showed to the link http://fabrikar.com/forums/index.ph...-list-for-an-element.47031/page-2#post-244670
 
I don't know what to tell you then - because, in testing this for you, I created a new table using the latest DIV template from Github - and the delete button worked fine (and it didn't mater if I checked or unchecked the checkbox for the 'Hide checkbox' option).

What Joomla template are you using?
Can you provide a screen snip so we can see and better understand the problem?

I don't see why you can't just control the css with the template custom_css.php file.
 
In the recent div template the fix is line 21.
If you have an other line the div template (copy) is not the original recent one.

With the recent div template (including the fix) and element CSS it is definitively working.
Maybe you have some unbalanced code in your custom div or in your custom CSS.
 
Thanks to everybody. Until yesterday I was using the old template folders. Now I have created new templates folders in the following way:
1) copy the div folder (from recent Gitub update) replacing the old folders (old copies of the div template);
2) replace the custom_css
3) update the default_row to the amendment by Troester (above in this thread #3)
4) update the default.php to the wanted settings (columns number, etc.)

Everything seems working ok (including the css properties).
Thanks again.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top