mikepop Posted January 22 Share Posted January 22 Hello. We are trying to modify the order of the domain listing. To do this we have tried to modify the clientreadomains.tpl script {include file="$template/includes/tablelist.tpl" tableName="DomainsList" noSortColumns="0, 1" startOrderCol="2" filterColumn="5"} <script> jQuery(document).ready(function () { var table = jQuery('#tableDomainsList').show().DataTable(); {if $orderby == 'domain'} table.order(2, '{$sort}'); {elseif $orderby == 'regdate' || $orderby == 'registrationdate'} table.order(3, '{$sort}'); {elseif $orderby == 'nextduedate'} table.order(4, '{$sort}'); {elseif $orderby == 'autorenew'} table.order(5, '{$sort}'); {elseif $orderby == 'status'} table.order(6, '{$sort}'); {/if} table.draw(); jQuery('#tableLoading').hide(); }); </script> Changing the default order from 2 to 6 (status) but it doesn't work. It always overwrites the value we modify and orders it by name (default order). Thank you! 0 Quote Link to comment Share on other sites More sharing options...
Solution Saroha Posted February 12 Solution Share Posted February 12 Hello, It happen because WHMCS's default orderby is domain and its not affected by changing below code noSortColumns="0, 1" startOrderCol="2" filterColumn="5" again one more thing <script> jQuery(document).ready(function () { var table = jQuery('#tableDomainsList').show().DataTable(); {if $orderby == 'domain'} table.order(2, '{$sort}'); {elseif $orderby == 'regdate' || $orderby == 'registrationdate'} table.order(3, '{$sort}'); {elseif $orderby == 'nextduedate'} table.order(4, '{$sort}'); {elseif $orderby == 'autorenew'} table.order(5, '{$sort}'); {elseif $orderby == 'status'} table.order(6, '{$sort}'); {/if} table.draw(); jQuery('#tableLoading').hide(); }); </script> This code is useless because it always call first IF orderby=domain if you want to change you column order number then change first if code table.order(2, '{$sort}'); //change 2 with the column number by which you want to short for Example i short default column number 4 then my code is <script> jQuery(document).ready(function () { var table = jQuery('#tableDomainsList').show().DataTable(); {if $orderby == 'domain'} table.order(4, '{$sort}'); {elseif $orderby == 'regdate' || $orderby == 'registrationdate'} table.order(3, '{$sort}'); {elseif $orderby == 'nextduedate'} table.order(4, '{$sort}'); {elseif $orderby == 'autorenew'} table.order(5, '{$sort}'); {elseif $orderby == 'status'} table.order(6, '{$sort}'); {/if} table.draw(); jQuery('#tableLoading').hide(); }); </script> It works fine and also works with the sort filter above the table. 0 Quote Link to comment Share on other sites More sharing options...
mikepop Posted February 20 Author Share Posted February 20 Hello Saroha, thanks for your answer. We had tried that solution but we were trying to sort by column 6 which should correspond to the domain status, after several attempts we have verified that for some reason the domain status order is column 5. Now it works. Thanks again. 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.