I have OpenCart 1.5.1.1 installed. I want to be able to show and hide columns in the Admin->Product List
On the Admin->Product List page. When I click the "Toggle Columns" Button. I can check the checkboxes for the columns to display in the Product List, but I
cannot "uncheck" the columns, all of the columns that are initially checked remain checked, if I check a column it remains checked.
Is this a jQuery issue?
I am guessing that this has something to do with jQuery. Maybe because OpenCart 1.4.9+ uses a different version of jQuery than OpenCart 1.5.1 I really do not know. I am definitely not a jQuery expert. Any ideas?
I see that the demo works great with OpenCart version 1.4.9.3 installed. I have OpenCart 1.5.1.1 installed.
Here is my code:
admin\controller\catalog\product_manager.php referencing the jQuery files for OpenCart 1.5.1.1
Code: Select all
$this->document->addStyle('view/javascript/jquery/dataTables/css/dataTables.css');
$this->document->addStyle('view/javascript/jquery/dataTables/css/TableTools.css');
$this->document->addStyle('view/javascript/jquery/dataTables/css/TableTools.print.css','stylesheet','print');
$this->document->addStyle('view/javascript/jquery/dataTables/css/ColVis.css');
$this->document->addScript('view/javascript/jquery/dataTables/js/jquery.dataTables.min.js');
$this->document->addScript('view/javascript/jquery/jquery.jeditable.min.js');
$this->document->addScript('view/javascript/jquery/dataTables/js/TableTools.min.js');
$this->document->addScript('view/javascript/jquery/dataTables/js/ColVis.min.js');
admin\view\template\common\header.tpl referencing the jQuery files for OpenCart 1.5.1.1
Code: Select all
<script type="text/javascript" src="view/javascript/jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-1.8.9.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.9.custom.css" />
<script type="text/javascript" src="view/javascript/jquery/ui/external/jquery.bgiframe-2.1.2.js"></script>
<script type="text/javascript" src="view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="view/javascript/jquery/superfish/js/superfish.js"></script>
admin\view\template\catalog\product_manager_list.tpl for OpenCart 1.5.1.1
Code: Select all
<table class="list display" width="100%" id="productTable_<?php echo $store['store_id']; ?>">
<thead>
<tr>
<th style="text-align: center;"><input type="checkbox" id="toggleCheckbox_<?php echo $store['store_id']; ?>" onclick="toggleSelect()" /></th>
<?php foreach ($columns as $column) {
if ($column['key'] != 'selected') {
echo '<th class="left">' . ${'column_'.$column['key']} . '</th>' . "\n";
}
} ?>
</tr>
</thead>
<tbody>
<tr>
<td class="center" style="height: 150px;" colspan="<?php echo count($columns); ?>" class="dataTables_empty"> </td>
</tr>
</tbody>
</table>
Code: Select all
function toggleSelect() {
var store = $('#tabs .selected').attr('id').split('_')[1];
$('#form_'+store+' input[name*=\'selected\']').attr('checked', $('#toggleCheckbox_'+store).attr('checked'));
}
What is causing me to not be able to uncheck any Column Checkboxes after clicking the "Toggle Button"?
Do I need to change any code above? I believe that OpenCart 1.5.1 is using jquery 1.6.1 and OpenCart 1.4.9+ is using jquery 1.3.2
Does anyone have any ideas?
Thank you.