Char = sData.charAt(0); from v1.5 beta 11

Char = sData.charAt(0); from v1.5 beta 11

kikokiko Posts: 10Questions: 0Answers: 0
edited July 2009 in Bug reports
Hi, im just newbie for this jquery datatables. I recived error sData is undefined [Break on this error] Char = sData.charAt(0);
jquery.d...Tables.js (line 513)
below is the code:
[code]

<%@ include file="header.jsp"%>
 




List of Suppliers searched for All between the date range 21-JUN-2008 and 21-JUL-2008
Total POs: ${poCount}
Total RFQs: ${rfqCount}
Total QOTs: ${qotCount}



DataTables individual column filtering example






Company Type
TNID
Branch Name
Country
No of POs
No of RFQs
No of QOTs
No of Buyer That Sent POs
Interface





${stat.companyType}
${stat.tnid}
${stat.branchName}
${stat.country}
${stat.poCount}
${stat.rfqCount}
${stat.qotCount}
${stat.buyerSentPOCount}
${stat.companyInterface}






















 
 
 
Total:
${poCount}
${rfqCount}
${qotCount}
 
 





[/code]

Replies

  • kikokiko Posts: 10Questions: 0Answers: 0
    below is the generated source code:
    [code]





    DataTables individual column filtering example






    Company Type

    TNID
    Branch Name
    Country
    No of POs
    No of RFQs
    No of QOTs

    No of Buyer That Sent POs
    Interface





    STARTGROUP

    51596
    Goltens Hong Kong Ltd.
    HK
    0
    1
    0

    0
    STARTSUPPLIER



    STARTGROUP
    52712
    Elcome International

    AE
    1
    0
    0
    1
    STARTSUPPLIER



    CONTRACTED
    52903
    Fuji Trading (Singapore) Pte. Ltd.
    SG
    0

    3
    0
    0
    INTEGRATION



    STARTGROUP

    59026
    S & W Heat Exchangers
    SG
    0
    1
    0

    0
    STARTSUPPLIER


























    [/code]
  • kikokiko Posts: 10Questions: 0Answers: 0
    but when i tried it to v 1.4 I received:
    sData is undefined
    [Break on this error] for ( i=0 ; i
  • allanallan Posts: 57,234Questions: 1Answers: 9,113 Site admin
    Hi kiko,

    You have TH elements in the TBODY. Try changing them to TD.

    It is actually valid to have TH in the body, but, DataTables expects there to only be TD elements for simplicity.

    Regards,
    Allan
  • kikokiko Posts: 10Questions: 0Answers: 0
    whoah!!! great. Thanks allan. by the way how can I put the search filter above the head? what i know is I have to do anonther table and put on top of the main table, but i dont know if it works. any advice would be very much appreciate.
  • allanallan Posts: 57,234Questions: 1Answers: 9,113 Site admin
    Hi kiko,

    If you want to move the search box around the table itself you can use the sDom parameter ( http://datatables.net/usage#sDom ), however if you want to move the filter far away from the table, you'll need to make use of the fnFilter() API function and add an event handler to the input box that you put in the HTML.

    Allan
  • kikokiko Posts: 10Questions: 0Answers: 0
    do you have some example on how to do it? what about moving pagination, next button, etc...
  • allanallan Posts: 57,234Questions: 1Answers: 9,113 Site admin
    HI kiko,

    sDom demo: http://datatables.net/examples/example_dom.html
    Filtering demo: http://datatables.net/1.5-beta/examples/api/regex.html
    Custom paging: http://datatables.net/plug-ins#pagination (you would need to write your own plug-in is sDom doesn't provide enough control for the DOM location).

    Allan
  • Luda AmebaLuda Ameba Posts: 11Questions: 0Answers: 0
    Hi Allan,
    I have also encountered the same bug but in different situation,
    My table have no inner-html and is totally dynamically created, when I insert the data into table an error occurs on line 514 Char = sData.charAt(0); when I killed this part by placing return null on line 507 everything work fine.

    Part where I add data to table
    [code]success: function(xml) {
    var data = $(xml).children("response:first").text();
    var rows = eval('(' + data + ')');

    if(tbl != null) {
    tbl.fnClearTable(0);
    tbl.fnAddData(rows[1]);
    }
    }

    // rows[1] part is 2D array looks like this
    // [ [ r11, r12 ] , [ r21, r22 ] , [ r31, r32], ... [ rn1, rn2] ]
    [/code]
    This code was working fine in version 1.4.3 then in 1.5 beta 7 but in 1.5 beta 11 isn’t working. :-)
    Luda Ameba
  • allanallan Posts: 57,234Questions: 1Answers: 9,113 Site admin
    Regarding Luda's comment, please see thread http://datatables.net/forums/comments.php?DiscussionID=424 .
    A
  • kikokiko Posts: 10Questions: 0Answers: 0
    thank you Allan! I have 1 more question, how can I add in "Show All" in Show (10) Entries
  • allanallan Posts: 57,234Questions: 1Answers: 9,113 Site admin
    Hi kiko,

    Have a look at the example here for sLengthMenu: http://datatables.net/usage#oLanguage.sLengthMenu

    If you give -1 as the length to display it will show all.

    Allan
  • kikokiko Posts: 10Questions: 0Answers: 0
    thank you very much it helps a lot
This discussion has been closed.