radek.
radek.

Reputation: 378

Add Chardin plugin to Datatables


I have some code looks like:

$('#button').on('click', function() { $('body').chardinJs('start') });

$(document).ready(function() {
   $('#example').dataTable({
        "sDom": 'f'
      });

} );

(This is only JS/Jquery part in Jsfiddle added a whole) http://jsfiddle.net/wAUKV/18/
As You can see when I click a 'tip' image the charding plugin will start and show some tips for my website section. The problem comes when I want to add notes to the DOM DataTables.
How I can solved this problem?

Upvotes: 1

Views: 74

Answers (1)

davidkonrad
davidkonrad

Reputation: 85578

OK, the problem is that the different controls are injected into the .dataTables_wrapper element after initialisation. To add chardin text to the search box only (left to the "search" <input>) :

$(".dataTables_filter input")
   .attr("data-intro", "Type here to search in the table")
   .attr("data-position", "left");

http://jsfiddle.net/La4a93vv/


"loop" is called the lengthmenu :

$(".dataTables_length")
   .attr("data-intro", "Select number of visible rows")
   .attr("data-position", "right");

your fiddle updated -> http://jsfiddle.net/wAUKV/33/

Simply just inspect the injected markup to see what elements (=selectors) you should use to add "chardins".

Upvotes: 1

Related Questions