Extra sort wrapper added everytime on reinitialization

Extra sort wrapper added everytime on reinitialization

chobochobo Posts: 3Questions: 0Answers: 0
edited April 2011 in General
Hi, I am having some trouble with reinitializing a dataTable. I have an event handle that open a dialog on click which contains a dataTable. I initialize the table like this

[code]
var oDataTable = $(this).dataTable(
{
"bJQueryUI": true,
"bFilter": true,
"bAutoWidth": false,
"bDestroy": true,
"sPaginationType": "full_numbers",
"aaSorting": [[1, 'asc']], //Default sorting on email / username
"oLanguage":
{
"sZeroRecords": "Add some courses to your planner"
},
"aoColumns":
[
{"bSortable": false, "bSearchable": false }, // Permission Id
{"bSortable": true, "bSearchable": true }, // email / username
{"bSortable": false, "bSearchable": false }, // view permission
{"bSortable": false, "bSearchable": false }, // edit permission
{"bSortable": false, "bSearchable": false }, // delete permission
{"bSortable": false, "bSearchable": false } // delete row
],
"fnInitComplete": function ()
{

$(this).show();
}
[/code]


I use bDestroy to handle reinitializing the table everytime a user opens the dialog. The problem I am having is if the dialog is opened more than one time the table styling gets messed up.

In the code I noticed that it is adding an extra sort wrapper in the headers as well.

This is what is looks like on the first click (working)
[code]


Email



[/code]

This is what is looks like if I open and close the dialog containing the dataTable three times. Notice how it keeps adding DataTables_srot_wrapper. Adds a new one each time you open and close it.
[code]



Email




[/code]

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    That looks like a bug I'm afraid - sorry :-( . I'll see if I can address that in the next release. Until then I'm afraid that the work around is to manually remove the element - I can't think of another way of doing it (well, I suppose you could cache the header contents, but that's a bit rubbish).

    Allan
  • chobochobo Posts: 3Questions: 0Answers: 0
    Thanks for the response Allan. It shouldn't be hard to work around :) I just wasn't sure if I was missing something on my end.
  • diegodiasdiegodias Posts: 1Questions: 0Answers: 0
    I'm facing the same issue, do you have any idea how can i fix it or just workaround?
This discussion has been closed.