fnAdjustColumnSizing doesn't work after ajax processing

fnAdjustColumnSizing doesn't work after ajax processing

AweaAwea Posts: 3Questions: 0Answers: 0
edited January 2012 in General
Hi guy,

I'm currently doing something like this to get some data and display it in a datatables :

[code]
oTable = $('.datatable').dataTable( {
"sScrollX": "100%",
"sScrollXInner": "200%",
"bScrollCollapse": true,
"bDestroy" : true,
"sAjaxSource": "xhr.php",
"bFilter": false,
"bSort": false,
"bLengthChange": false,
"bPaginate": false,
"bInfo": false,
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": "webservice.php",
"data": 'id=' + quotation_id + '&customer_id=' + id + '&action=true',
"success": function(msg){
fnCallback(msg);
}
});
},
"fnInitComplete": function() {
this.fnAdjustColumnSizing();
}
});
[/code]

But the fnAdjustColumnSizing won't work, if I use it on a click element or something else it work fine.
Any idea to solve this and make it work after the ajax processing ?

Replies

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Could you post a link to a demo page showing the problem please? Looking at it, fnAdjustColumnSizing most certainly should be getting called at the end of the initialisation.

    Allan
  • AweaAwea Posts: 3Questions: 0Answers: 0
    You can fin a demo page showing the problem here : http://bit.ly/vgWmMJ

    To complete the form, you can put this data :
    - click one of the radio
    - bob
    - test
    - 18/04/1990
    - 0630700614
    - blabla@awea.fr
    - click 'non'
    - 0
    - 13005
    - 95 rue du test
    - 12/01/2012
    - 550

    Thanks for your help -)
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    First thing I would suggest is removing this line:

    [code]
    "sScrollXInner": "200%",
    [/code]

    There is a misalignment in the columns and I suspect that is the problem. If that doesn't do it, let me know and I'll see if I can create a local version that I can experiment with.

    Allan
  • AweaAwea Posts: 3Questions: 0Answers: 0
    I try your suggest but It doesn't work. I obtain this : http://ScrnSht.com/dkbyda
This discussion has been closed.