sWidth not works

sWidth not works

AndzinSanAndzinSan Posts: 6Questions: 0Answers: 0
edited October 2010 in Bug reports
Hi, at first I want to tell you that DataTables is great ;).
Second thing: sorry for my bad english.
Now go to the problem:

I am using DataTables (following DT) with some css modifications for better jQueryUI theme support, NOT CORE MODIFICATIONS!
Here is my DT configuration:
[code]var oTable = $('table.display').dataTable(
{
"oLanguage": {"oPaginate": {"sFirst": "«",
"sLast": "»",
"sNext": "›",
"sPrevious": "‹",
},
"sEmptyTable": "Ziadne data nie su k dispozicii",
"sInfo": "Celkovo _TOTAL_ z

Replies

  • AndzinSanAndzinSan Posts: 6Questions: 0Answers: 0
    edited October 2010
    And this is AJAX output:
    [code]{"aaData":[["24","1","no","MacGyver.4x13-19.iNTERNAL.FS.DVD.XviD.CZ-CB","-1",null,"2010-11-19 18:15:57","Piatok, 19.11. 2010, 18:15:57","2636071155","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","15",null,"0","1","0","0"],["75","1","no","dokumenty_test.dir.torrent","-1",null,"2010-10-19 23:15:57","Utorok, 19.10. 2010, 23:15:57","9583755","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","0",null,"0","1","0","0"],["70","1","no","StarGate.8x11-8x20.DVDrip.CZ.EN.MultiDub-HM.torrent","-1",null,"2010-10-19 10:59:57","Utorok, 19.10. 2010, 10:59:57","4294967295","yes","2010-10-19 10:59:57",null,"Movies","tv_xvid.png","15",null,"0","0","0","0"],["73","1","no","Stargate.Atlantis.S04E02.Zachranne.Lano.WS.DVDRip.XviD.CZ.ENG-MaT.torrent","-1",null,"2010-10-19 10:30:57","Utorok, 19.10. 2010, 10:30:57","428607528","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","0",null,"0","63","0","0"],["74","1","no","dokumenty_test.file.MP3.torrent","-1",null,"2010-10-19 10:30:30","Utorok, 19.10. 2010, 10:30:30","6178149","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","0",null,"0","1","0","0"],["69","1","no","The.O.C.S03E17.The.Journey.2006.iNTERNAL.WS.DVDRip.XviD.CZ-BedNa","-1",null,"2010-10-19 02:25:57","Utorok, 19.10. 2010, 02:25:57","367190251","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","15",null,"0","1","0","0"],["18","1","no","Mafstory.EP04-10.DVB.XviD.SK-lepalo","-1",null,"2010-10-18 18:15:57","Pondelok, 18.10. 2010, 18:15:57","1714448841","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","11",null,"0","1","0","0"],["21","1","no","Band.of.Brothers.2001.1x02.720p.HDTV.DivX.MultiDub.CZ-cuko","-1",null,"2010-10-17 18:15:57","Nede\u013ea, 17.10. 2010, 18:15:57","1978383899","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","12",null,"0","1","0","0"],["25","1","no","Bez.obav.prosim.2006.10.29.DVB.XviD.SK-TS","-1",null,"2010-05-19 18:15:57","Streda, 19.5. 2010, 18:15:57","379224688","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","13",null,"0","1","0","0"],["26","1","no","Verte.neverte.PACK.4x08-12.TVrip.XviD.CZ-MLB","-1",null,"2001-10-19 18:15:57","Piatok, 19.10. 2001, 18:15:57","1841994833","yes","0000-00-00 00:00:00","0000-00-00 00:00:00","Movies","tv_xvid.png","18",null,"0","1","0","0"]]}[/code]

    As you see I am trying to set fixed column width (in DT conf seted to 550px for all columns - just test), but it not works. I tried everything from advices which I found in this forums in last 3 days. Trying use fnAdjustColumnSizing(), fnDraw(), diferent DT conf combinations with turned on/off bAutoWidth, trying set column width in fnRender - nothing works. Then I try some HARD CODE core HACK - find and replace/comment column width script but nothing works - core is too much big for finding all.

    Now when I click to head for reorder, some columns are resized - this depends on how long is content in column, i.e. in 1. page longest content is 20 chars, soo column width is short, but on 2. page is longest content 50 chars, after reorder longest content from 2. page go to 1. page and column width is resized - I need eliminate this behavior.

    Here is screens of actual output with my DT configuration, I need set to each column specific width in all cases:
    http://img26.imageshack.us/img26/2513/zachyti1.png

    Now after 3 days (40 hours of work) I am desperate. I dont have more ideas how to fix it. Can you help me??
  • AndzinSanAndzinSan Posts: 6Questions: 0Answers: 0
    Hi, after sleepless night I found this hard core code hack:

    In DT conf set "sWidth" as integer, not an string, for example: "sWidth": 550
    Then in core comment this lines:

    cca line | commented source
    ----------------------------------------
    2131 //oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);
    3520 //nScrollHead.style.width = _fnStringToCss( oSettings.oScroll.sX );
    3521 //nScrollBody.style.width = _fnStringToCss( oSettings.oScroll.sX );
    3525 //nScrollFoot.style.width = _fnStringToCss( oSettings.oScroll.sX );
    3656 //iSanityWidth = $(o.nTable).outerWidth();
    3675 //o.nTable.style.width = _fnStringToCss(o.oScroll.sXInner);
    3681 //o.nTable.style.width = _fnStringToCss( iSanityWidth-o.oScroll.iBarWidth );
    3685 //o.nTable.style.width = _fnStringToCss( iSanityWidth );
    3691 //o.nTable.style.width = _fnStringToCss( iSanityWidth );
    3700 //iSanityWidth = $(o.nTable).outerWidth();
    3717 //nToSize.style.width = _fnStringToCss( iWidth );
    3751 //nSizer.style.width = _fnStringToCss( aApplied.shift() );
    3812 //nScrollHeadTable.style.width = _fnStringToCss( $(o.nTable).outerWidth() );
    3813 //nScrollHeadInner.style.width = _fnStringToCss( $(o.nTable).outerWidth()+o.oScroll.iBarWidth );
    5327 //oSettings.nTable.style.width = _fnStringToCss( $(nCalcTmp).outerWidth() );


    Then found this:
    var nThs = _fnGetUniqueThs( nTheadSize );
    for ( i=0, iLen=nThs.length ; i
This discussion has been closed.