Enable dialogs after pagination + export in summary reports (#539)

This commit is contained in:
jekkos
2016-05-10 18:31:08 +02:00
parent ffd212da14
commit 2171efcb7a
3 changed files with 35 additions and 66 deletions

View File

@@ -31,6 +31,7 @@
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
striped: true,
sortable: true,
showExport: true,
pagination: true,
showColumns: true,
showExport: true,

View File

@@ -1,15 +1,4 @@
<?php
// Check if for excel export process
if($export_excel == 1)
{
ob_start();
$this->load->view("partial/header_excel");
}
else
{
$this->load->view("partial/header");
}
?>
<?php $this->load->view("partial/header");?>
<div id="page_title"><?php echo $title ?></div>
@@ -30,62 +19,40 @@
?>
</div>
<?php
if($export_excel == 1)
{
$this->load->view("partial/footer_excel");
$content = ob_end_flush();
$filename = trim($filename);
$filename = str_replace(array(' ', '/', '\\'), '', $title);
$filename .= "_Export.xls";
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);
echo $content;
die();
}
else
{
?>
<script type="text/javascript" language="javascript">
$(document).ready(function()
<script type="text/javascript" language="javascript">
$(document).ready(function()
{
var detail_data = <?php echo json_encode($details_data); ?>;
var init_dialog = function()
{
var detail_data = <?php echo json_encode($details_data); ?>;
$('#table').bootstrapTable({
columns: <?php echo transform_headers_readonly($headers['summary']); ?>,
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
striped: true,
pagination: true,
sortable: true,
showColumns: true,
uniqueId: 'id',
data: <?php echo json_encode($summary_data); ?>,
iconSize: 'sm',
paginationVAlign: 'bottom',
detailView: true,
onExpandRow: function (index, row, $detail) {
$detail.html('<table></table>').find("table").bootstrapTable({
columns: <?php echo transform_headers_readonly($headers['details']); ?>,
data: detail_data[index]
});
}
});
<?php
if (isset($editable))
{
?>
table_support.submit_handler('<?php echo site_url("reports/get_detailed_" . $editable . "_row")?>');
dialog_support.init("a.modal-dlg");
<?php
}
?>
};
$('#table').bootstrapTable({
columns: <?php echo transform_headers_readonly($headers['summary']); ?>,
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
striped: true,
pagination: true,
sortable: true,
showColumns: true,
uniqueId: 'id',
showExport: true,
data: <?php echo json_encode($summary_data); ?>,
iconSize: 'sm',
paginationVAlign: 'bottom',
detailView: true,
onPageChange: <?php echo isset($editable); ?> && init_dialog,
onExpandRow: function (index, row, $detail) {
$detail.html('<table></table>').find("table").bootstrapTable({
columns: <?php echo transform_headers_readonly($headers['details']); ?>,
data: detail_data[index]
});
}
});
</script>
<?php $this->load->view("partial/footer"); ?>
<?php
} // end if not is excel export
?>
<?php echo isset($editable); ?> && init_dialog();
});
</script>
<?php $this->load->view("partial/footer"); ?>

View File

@@ -196,6 +196,7 @@
showColumns: true,
clickToSelect: true,
showExport: true,
onPageChange: load_success(options.onLoadSuccess),
toolbar: '#toolbar',
uniqueId: options.uniqueId || 'id',
onCheck: enable_actions,