Using highlight plugin jquery datatable in visualforce

Using highlight plugin jquery datatable in visualforce

scannyscanny Posts: 2Questions: 1Answers: 0

Hi,

So I've included the following scripts and stylesheets:

<apex:includescript value="//code.jquery.com/jquery-1.12.3.js" / >
<apex:includescript value="//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js" />
<apex:includeScript value="/soap/ajax/26.0/connection.js"/>
<apex:includeScript value="/support/console/26.0/integration.js"/>
<apex:stylesheet value="https://github.com/DataTables/Plugins/blob/master/features/searchHighlight/dataTables.searchHighlight.css"/>
<apex:includeScript value="https://github.com/DataTables/Plugins/blob/master/features/searchHighlight/dataTables.searchHighlight.js"/>
<apex:includeScript value="https://github.com/DataTables/Plugins/blob/master/features/searchHighlight/dataTables.searchHighlight.min.js"/>
<apex:includeScript value="https://bartaz.github.io/sandbox.js/jquery.highlight.js"/>

<

script type="text/javascript">

and I've set the searchHighLight parameter to true in my datatable initialization:

j$ = jQuery.noConflict();
j$(document).ready( function () {
var orderNotesTable = j$('[id$="ordernotestable"]').DataTable({
"searchHighlight" : true,
"aaSorting": [[0,"asc"]],
"bInfo" : false,
"aoColumnDefs": [ { "bSortable": false, "aTargets": [0, 1, 2, 3, 4 ] } ],
"iDisplayLength": -1,
"aLengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All" ]],
"language": {
"emptyTable": "No current notes on this order."
},

but absolutely no effect. Any ideas?

Thanks

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,248Questions: 26Answers: 4,929
    edited December 2016 Answer ✓

    If I load the JS and CSS from the links you are using (github.com) the highlighting does not work. If I load them using the URL in this blog it works fine:
    https://datatables.net/blog/2014-10-22

    Note: I'm not using Visualforce.

    HTH
    Kevin

  • scannyscanny Posts: 2Questions: 1Answers: 0

    That worked! Thank you Kevin.

This discussion has been closed.