Remitur Posted September 16, 2017 Share Posted September 16, 2017 In the general domain management page in client area ( /clientarea.php?action=domains ) you can select several domains for mass actions... but you need to select singularly every one you need. I would like to insert a "select all" tickbox ... but how to do it?!?!?! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 17, 2017 Share Posted September 17, 2017 by adding some jQuery to the clientareadomains.tpl template... <script type="text/javascript"> function toggle(source) { var checkboxes = document.querySelectorAll('input[type="checkbox"]'); for (var i = 0; i < checkboxes.length; i++) { if (checkboxes[i] != source) checkboxes[i].checked = source.checked; } } </script> and then changing the initial heading column from... <th width="20"></th> to... th width="20"><input type="checkbox" onclick="toggle(this);" /> {$LANG.all}</th> I suppose you could add the jQuery using an action hook instead, but I can't see a way of adding the 'select all' checkbox to the table without editing the template... so you might as well do it all in the template. 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted September 17, 2017 Author Share Posted September 17, 2017 by adding some jQuery to the clientareadomains.tpl template... Nice trick! It's exactly what I need! But... where is the right point in .tpl for inserting the jquery script? I tried inserting it in two different points (which seemed reasonable), but no effect... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 18, 2017 Share Posted September 18, 2017 I put it after the first <script> block and before the beginning of the form... {if $warnings} {include file="$template/includes/alert.tpl" type="warning" msg=$warnings textcenter=true} {/if} <div class="tab-content"> <div class="tab-pane fade in active" id="tabOverview"> {include file="$template/includes/tablelist.tpl" tableName="DomainsList" noSortColumns="0, 6" startOrderCol="1" filterColumn="5"} <script type="text/javascript"> jQuery(document).ready( function () { var table = jQuery('#tableDomainsList').removeClass('hidden').DataTable(); {if $orderby == 'domain'} table.order(1, '{$sort}'); {elseif $orderby == 'regdate' || $orderby == 'registrationdate'} table.order(2, '{$sort}'); {elseif $orderby == 'nextduedate'} table.order(3, '{$sort}'); {elseif $orderby == 'autorenew'} table.order(4, '{$sort}'); {elseif $orderby == 'status'} table.order(5, '{$sort}'); {/if} table.draw(); jQuery('#tableLoading').addClass('hidden'); }); </script> <script type="text/javascript"> function toggle(source) { var checkboxes = document.querySelectorAll('input[type="checkbox"]'); for (var i = 0; i < checkboxes.length; i++) { if (checkboxes[i] != source) checkboxes[i].checked = source.checked; } } </script> 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.