Modifying oSettings.aanFeatures.r

Modifying oSettings.aanFeatures.r

psharppsharp Posts: 39Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Greetings and thanks for this awesome plugin!

I've looked and looked through google searches and the documentation on how to change this, but could not find any reference to it.

I would like to change the default "Processing..." text box (enabled with 'bProcessing' : true.
We have a wait mask element that people are familiar with seeing and the datatables "Processing..." screen is causing issues (visual preference only)

IS there a way to modify / set this during the init call of datatables?

I've tried adding :
'fnPreDrawCallback' : function(oSettings) {oSettings.aanFeatures.r[0] = $('#wait_mask')[0];return true;}

which does not appear to be working.

Any ideas?

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    I'd suggest that rather than using the built in processing option, if you want to use an external method, listen for the `processing` event and show / hide your indicator on that: http://datatables.net/docs/DataTables/1.9.4/DataTable.html#processing

    Allan
  • psharppsharp Posts: 39Questions: 0Answers: 0
    @Allan,

    Thanks a million. It took all of 14 seconds to add your recommended change and all is good.

    For those who are wondering how, here is a copy of my init (sans showHide function because it is not relevant):

    [code]
    $(document).ready(function(){
    var oTable = $('#dtable')
    .bind('processing',function(e, oSettings, bShow){showHide(bShow)})
    .dataTable({
    'aoColumnDefs' : [{'bSortable' : false, 'aTargets' : [4,12]}],
    'oLanguage' : {'sSearch' : 'Highlight in results:'},
    'bJQueryUI' : true,
    'bProcessing' : false,
    'bServerSide' : true,
    'bPaging' : true,
    'sPaginationType' : 'full_numbers',
    'aLengthMenu' :[[10,20,30,50,100],[10,20,30,50,100]],
    'iDisplayLength' : 20,
    'fnInitComplete' : function(){this.fnSetFilteringDelay(750);},
    'sAjaxSource' : 'controller/xxxx.php?action=history_ajax',
    'fnServerData' : function( sSource, aoData, fnCallback ) {
    $.getJSON(sSource, aoData, function(json){
    totals = json.fac_totals; // important! Sent by the controller
    fnCallback(json);
    });
    }
    })
    [/code]
This discussion has been closed.