Jump to content

CLIENT AREA DOMAINS SORT


Go to solution Solved by Saroha,

Recommended Posts

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!

Link to comment
Share on other sites

  • 3 weeks later...
  • Solution

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.

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated