Skip Navigation

[Resolved] display sorting indicator in table by always (instead of only in hover mode)

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 31 replies, has 3 voices.

Last updated by hemaK 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1363519

Tell us what you are trying to do?
Display sorting indicator in table by default always, instead only when hovering over the text in 1st row

Is there any documentation that you are following? Did not find related documentation

Is there a similar example that we can see?

What is the link to your site? hidden link

#1363539

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hema,

Thank you for getting in touch.

Actually to do this you will perhaps need to use the bootstrap data tables.
hidden link

Please try setting up your table like the example and it should allow you to have this option.

Thanks,
Shane

#1363589

Thanks shane for the quick response !

Can you please elaborate, how I can get the bootstrap data tables as a part of the view loop wizard?

#1363593

is there a plugin to install this option?

#1363601

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hema,

Currently you are displaying your view as a table.

All you need to do is to replace the classes of the table with the one in the link that i've provided.

As well as adding the Javascript to the view.

The section below the table gives an example of how the data table is built. All you need to do is to replicate this structure in Views .

However the Javascript that you will need to use is the one below.

jQuery(document).ready(function() {
    jQuery('#example').DataTable();
} );

Please let me know if this clears things up for you.

Thanks,
Shane

#1363645

Hi Shane -

I followed the instructions i.e. created view and added the javascript as well class of the table. see attachment - 1

I am still not getting the sorting options in the 1st row of the table. see attachment - 2

Update: all screenshots are deleted as per user request

#1363733

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hema,

Could you send me a link to where you have this setup so that I can have a look ?

Thanks,
Shane

#1363735

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Also could you try adding this to your functions.php



function wpb_data_tables() {
wp_register_script( 'datatables', '<em><u>hidden link</u></em>', array() ); //put any dependencies (including jQuery) into the array
wp_enqueue_script('datatables');

wp_register_script( 'datatables_bootstrap', '<em><u>hidden link</u></em>', array() ); //put any dependencies (including jQuery) into the array
wp_enqueue_script('datatables_bootstrap');

}
  
add_action( 'wp_enqueue_scripts', 'wpb_data_tables' );  

Thanks,
Shane

#1363743

Hi Shane - Are you looking for admin permission to access the defined view?

#1363749

Hi Shane - I updated the functions.php with the code you shared. I am still not getting the sorting options - although I am getting the show no. of rows and search within table option (see attachment)

Update: all screenshots are deleted as per user request

#1363767

Fyi - My originally request was to somehow have the "wpv-sorting-indicator" enforced by default

#1363773

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hema,

Could you send me a link to the page that you are testing this on ?

Also if possible could you provide admin access so that I can log in to see what is perhaps missing?

Thanks,
Shane

#1363775

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

However what you can do is to just use this css to ensure that the arrows are always showing.


.wpv-sorting-indicator{
display: inline;
}
#1363785

credential removed

#1363841

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hema,

Could you provide the credentials once more ?

Also I tried them previously and they dont seem to work.

Could you check on this and let me know.
Thanks,
Shane