Columns number

Columns number

TrollchikTrollchik Posts: 80Questions: 1Answers: 0
edited September 2011 in General
hi Allan, my yable contain 42 columns and when i use server side processing dataTable even dodn't send the request to server when i have so ,uch columns. If i have 41 and less columns everything is ok.

[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
var ch="";
for(var i=0; i

Replies

  • jcrawfordjcrawford Posts: 172Questions: 0Answers: 0
    I am guessing you are hitting the limit on the length of the http request string.
    See this for more information: http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url

    You might want to try a browser which does not limit and see if your table works then.
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    i guessed it... is it possible to split the json request to the server in dataTables? or what ur suggestions how to resolve it ?

    Thanks
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    edited September 2011
    also i know that dataTables send with request a lot of specific (i think unusefull information about each column, like sorting and so on...) information. Is t possible to cut it ?

    [code]
    {"name:""mDataProp_0","name":0}
    [/code]
    like above DataTable send by each column ....
  • GregPGregP Posts: 487Questions: 8Answers: 0
    42 columns! I would NOT want to have to deal with your data set. ;-) Good luck to you!

    By default, DataTables uses GET, which creates a long URL. You can use fnServerData to override the default method and use POST instead. POST does not have this length restriction since the parameters are sent in the header rather than the URL.
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    yeah i agree with you... i also don't want to deal with it, but it's a financial table and my boss wants to see all fields)))

    thanks for response, i'll try!
  • allanallan Posts: 63,180Questions: 1Answers: 10,411 Site admin
    Heh - that's a decent number of columns :-). Yup - while I know that DataTables is rather verbose about the information it sends, and thus this could be significantly reduced (there is another discussion about that) it sounds like a POST is the right thing to do: http://datatables.net/release-datatables/examples/server_side/post.html

    Regards,
    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    yes. thanks. The POST is working for me without any problems!
This discussion has been closed.