Move Success Message on Delete to Bottom??
- Single Page
Posted 26 January 2012 - 11:01 AM
What I delete a row from the table, the success message ids at the top.
Because of this the table bounces up and down and is quite distracting.
To be consistent, and remove the table from bouncing, is there a way to move this success message to the bottom under the table without hacking the core?
(not a massive issue but an improvement nevertheless)
Thanks!
Posted 26 January 2012 - 19:22 PM
You can simply change it from assets/grocery_crud/themes/datatables/views/list_template.php at around line 49:
.....
<?php
if(!empty($actions)){
?>
<style type="text/css">
<?php foreach($actions as $action_unique_id => $action){?>
<?php if(!empty($action->image_url)){ ?>
.<?php echo $action_unique_id; ?>{
background: url('<?php echo $action->image_url; ?>') !important;
}
<?php }?>
<?php }?>
</style>
<?php
}
?>
<!-- Move those lines here -->
<div id='report-error' class='report-div error report-list'></div>
<div id='report-success' class='report-div success report-list'>
</div>
<!-- ///////////////////////////////// -->
<?php if(!$unset_add){?>
<a role="button" class="edit_button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" href="<?php echo $add_url?>">
<span class="ui-button-icon-primary ui-icon ui-icon-circle-plus"></span>
<span class="ui-button-text"><?php echo $this->l('list_add'); ?> <?php echo $subject?></span>
</a>
<?php }?>
<div style='height:10px;'></div>
<?php echo $list_view?>
to the bottom of your list template, so it will be:
.....
<?php
if(!empty($actions)){
?>
<style type="text/css">
<?php foreach($actions as $action_unique_id => $action){?>
<?php if(!empty($action->image_url)){ ?>
.<?php echo $action_unique_id; ?>{
background: url('<?php echo $action->image_url; ?>') !important;
}
<?php }?>
<?php }?>
</style>
<?php
}
?>
</div>
<?php if(!$unset_add){?>
<a role="button" class="edit_button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" href="<?php echo $add_url?>">
<span class="ui-button-icon-primary ui-icon ui-icon-circle-plus"></span>
<span class="ui-button-text"><?php echo $this->l('list_add'); ?> <?php echo $subject?></span>
</a>
<?php }?>
<div style='height:10px;'></div>
<?php echo $list_view?>
<!-- Move the lines to here -->
<div id='report-error' class='report-div error report-list'></div>
<div id='report-success' class='report-div success report-list'></div>
<!-- ///////////////////////////////// -->
The same thing with the flexigrid theme. If you go to : assets/grocery_crud/themes/flexigrid/views/list_template.php at around line 21,22 and move those two lines at the end of the file (like datatables example) it will work fine. Actually I didn't thought that this was annoying. The bouncing it was just to understand that another record has been deleted.
However I think you are right. I have to change this one. Maybe a better information message with an X button, opacity and a fixed place that appears without bouncing. Also it has to dissapear after some seconds it will be much more better.
Thanks to mention it. I will have this in mind but not for the next version (1.1.9).
At the next version I will change the uploading plugin and the format that dates appears so I have some stuff to do. I try to this plugin fast as many users asked for it.
Posted 27 January 2012 - 15:31 PM
Thanks a lot
Posted 27 January 2012 - 21:33 PM
Posted 07 February 2012 - 11:19 AM
Just use JQuery to move the error and success boxes to after the flexigrid table (I have my own custom JQuery document ready code not in the flexigrid stiff so wont be changed on new updates):
/*******************************/
// MOVE FLEXIGRID ERROR TO BOTTOM
/*******************************/
$('.flexigrid').after($('#report-error').remove().clone());
$('.flexigrid').after($('#report-success').remove().clone());
The more I learn how to add in my own customisations in GroceryCRUD the much more flexible this app becomes, its fantastic.
Posted 07 February 2012 - 22:04 PM