⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Bootstrap Template and Multi views



pyromanci

pyromanci
  • profile picture
  • Member

Posted 19 July 2017 - 19:24 PM

The bootstrap template is designed in a way that makes multiple views on a single page impossible. 

 

The template used global values for ajax requests and duplicate element ids. Instead of the self contained values for the Datatables or Flexgrids templates.

 

What i mean is in the list_template.php file of the bootstrap template there is this:

	<script type='text/javascript'>
	var base_url = '<?php echo base_url();?>';

	var subject = '<?php echo $subject?>';
	var ajax_list_info_url = '<?php echo $ajax_list_info_url; ?>';
	var ajax_list_url = '<?php echo $ajax_list_url;?>';
	var unique_hash = '<?php echo $unique_hash; ?>';

	var message_alert_delete = "<?php echo $this->l('alert_delete'); ?>";
	var THEME_VERSION = '1.3.7';
	</script>
    <br/>
<div class="container gc-container">

 

So when you go to search or filter. All your grids do something different. I would recommend changing it this: 

	<script type='text/javascript'>
	var THEME_VERSION = '1.3.7';
	</script>
	<br/>
	<div class="container gc-container"
		data-unique_hash="<?php echo $unique_hash;?>"
		data-base_url = '<?php echo base_url();?>'
		data-subject = '<?php echo $subject?>'
		data-ajax_list_info_url = '<?php echo $ajax_list_info_url; ?>'
		data-ajax_list_url = '<?php echo $ajax_list_url;?>'
		data-message_alert_delete = "<?php echo $this->l('alert_delete'); ?>"
		>

Then from there changing the gcrud.datagrid.js file to look for those. As well change all the straight $('#<id>') or $('.<class>') class inside the gcrud.datagrid.js file as well to look under the container.