Problem with feature enablement

Problem with feature enablement

venht001venht001 Posts: 4Questions: 0Answers: 0
edited July 2010 in General
I am trying to dis/enable feature after the table has been initialised. I see some strange behaviour.
As long as i dont set any features the table appears as expected. This is part of the code:
[code]
$(document).ready(function(){
getBackendData(aktienaam2,tabelid2,tabelnavid2);


function getBackendData(aktie,tabelid,tabelnavid) {
jQuery.getJSON(dblocation + "wqsGetData?openagent&action=" + aktie + sessieparameters + "&callback=?",
function(data) {
notesData = data;
if (data.error){alert(data.error);return false;}
$(tabelid).html(''+ data.gegevens).show();
$(data.tabelid)
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $(tabelnavid)});
addDetailListener(notesData.tabelid);
}
);
}

});
[/code]

Now if i change the code to this :

[code]
$(document).ready(function(){
getBackendData(aktienaam2,tabelid2,tabelnavid2);


function getBackendData(aktie,tabelid,tabelnavid) {
jQuery.getJSON(dblocation + "wqsGetData?openagent&action=" + aktie + sessieparameters + "&callback=?",
function(data) {
notesData = data;
if (data.error){alert(data.error);return false;}
$(tabelid).html(''+ data.gegevens).show();
$(tabelid).dataTable( {
"bPaginate":false,
} );
$(data.tabelid)
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $(tabelnavid)});
addDetailListener(notesData.tabelid);
}
);
}

});
[/code]

The result is two search boxes and two lines Showing .. of .. entries

I have been trying to understand who this works, but I have no clue how to proceed.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    It is not currently possible to enable and disable features after intialisation - which is why there is no API function to allow this.

    It is sort of possible with 1.7 (currently in beta) since you now have the option to have the table destroyed (if one already exists) and then initialised with new parameters. http://datatables.net/new/1.7 (see the "DataTables object retrieval" section).

    Allan
  • venht001venht001 Posts: 4Questions: 0Answers: 0
    Allan thanks for your quick reply.
This discussion has been closed.