f0ska

f0ska does not currently provide support for this item.

2626 comments found.

@etattva , $xcrud->unset_csv(); $xcrud->unset_print();

Hi, I need Print Layout in View / Edit Mode Page. How can i create a print-button to print the view or edit page with fields and there content in other created Page for Example in “print.php” page? Thank you for your helph. Best regards TUGEM

ZillionG

ZillionG Purchased

I want to create a edit link on column {service} but don’t work, when click edit view is empty. thank you

$xcrud->column_pattern(‘service’, ‘{value}‘);

Hello can you tell me how can i rename value? I mean if for example operator id = 3 change 3>Smith if Operator id = 2 rename 2> John…

JinRoh

JinRoh Purchased

@buiglishvili $xcrud->column_pattern(‘name’, ‘{id} > {name}‘);

JinRoh

JinRoh Purchased

@ZillionG Your column_pattern is not OK You need to put your link in this with the xcrud-action edit $xcrud->column_pattern('service', '<a href="#" class="xcrud-action" data-task="edit" data-primary="{your_ID}">{value}</a>');
JinRoh

JinRoh Purchased

@Tugem You have to modify the xcrud_detail_view.php. I used jQuery.print.js for that.

<script type="text/javascript" src="js/jQuery.print.js"></script>
<?php echo $this->render_table_name($mode); ?>
<div class="xcrud-top-actions btn-group">
    <?php
    echo $mode == 'view' ? "<button type='button' id='cmd' class='btn btn-primary'><span class="glyphicon glyphicon-print" aria-hidden="true" /> Print</button>":"";
    echo $this->render_button('save_return','save','list','btn btn-primary','','create,edit');
    echo $this->render_button('save_new','save','create','btn btn-default','','create,edit');
    echo $this->render_button('save_edit','save','edit','btn btn-default','','create,edit');
    echo $this->render_button('return','list','','btn btn-warning'); ?>
</div>
<div class="xcrud-view">
<?php echo $mode == 'view' ? $this->render_fields_list($mode,array('tag'=>'table','class'=>'table')) : $this->render_fields_list($mode,'div','div','label','div'); ?>
</div>
<div class="xcrud-nav">
    <?php echo $this->render_benchmark(); ?>
</div>

<script type="text/javascript">
    $('#cmd').click(function () {
        //console.log( "ready!" );
        $('.xcrud').print({
            //Use Global styles
            globalStyles : true,
            //Add link with attrbute media=print
            mediaPrint : false,
            //Custom stylesheet
            stylesheet : "http://fonts.googleapis.com/css?family=Inconsolata",
            //Print in a hidden iframe
            iframe : false,
            //Don't print this
            noPrintSelector : ".btn",
            //Add this at top
            prepend : "",
            //Add this on bottom
            append : "",
            //Log to console when printing is done via a deffered callback
            deferred: $.Deferred().done(function() { console.log('Printing done', arguments); })
        });
    });
</script>

here bootbox confirmation for delete on xcrud:

change \plugins\xcrud.js on line 1068 c.a. (latest version)

replace :

$(”.xcrud”).on(“click”, ”.xcrud-action”, function() { var confirm_text = $(this).data(‘confirm’); if (confirm_text && !window.confirm(confirm_text)) { return; } else { var container = Xcrud.get_container(this); var data = Xcrud.list_data(container, this); if ($(this).hasClass(‘xcrud-in-new-window’)) { Xcrud.new_window_request(container, data); } else { if (data.task == ‘save’) { if (!Xcrud.validation_error) { Xcrud.unique_check(container, data, function(container) { data.task = ‘save’; Xcrud.request(container, data); }); } else { Xcrud.show_message(container, Xcrud.lang(‘validation_error’), ‘error’); } } else { Xcrud.request(container, data); } } } return false; });

with : });

}
else {
           xcrud_action_execution(this); 
        }
        return false;
    });  
function xcrud_action_execution(xcrud_button_object) {
        var container = Xcrud.get_container(xcrud_button_object);
        var data = Xcrud.list_data(container, xcrud_button_object);
        if ($(xcrud_button_object).hasClass('xcrud-in-new-window')) {
            Xcrud.new_window_request(container, data);
        } else {
            if (data.task == 'save') {
                if (!Xcrud.validation_error) {
                    Xcrud.unique_check(container, data, function(container) {
                        data.task = 'save';
                        Xcrud.request(container, data);
                    });
                } else {
                    Xcrud.show_message(container, Xcrud.lang('validation_error'), 'error');
                }
            } else {
                Xcrud.request(container, data);
            }
        }            
}

note : you have to have bootbox javascript in your page

change bootobox parameters as you need.

by
by
by
by
by
by