datatables - jquery data table, count several rows as a single row for the dropdown to select number of entries to show -


using jquery data table , following code dropdown option values above table 70,175,350 , all. want values show 10, 25, 50, all, every single row count should equal 7 rows.so when select 10 drodown, table should show 10*7=70 rows, 25 should show 175 rows etc.

var otable = $('#example').datatable({       "sdom": 't<"clear">lrtip',              "otabletools": {               "bsort": false,              "sswfpath": "datatables-1.9.4/extras/tabletools/media/swf/copy_csv_xls_pdf.swf",              "abuttons": [                 {                     "sextends": "xls",                     "sfilename": "*.xls"                 }             ]          },         "aasorting" : [],          "alengthmenu": [[10, 25, 50, -1], [70, 175, 350, "all"]],         }); 

how ?

i think want:

"alengthmenu": [[70, 175, 350, -1], [10, 25, 50, "all"]], 

from datatables web site: http://www.datatables.net/examples/advanced_init/length_menu.html

this parameter either 1d array of options used both displayed option , value, or 2d array (shown in example) use array in first position value, , array in second position displayed options (useful language strings such 'all').

edit idisplaylength

the above show 10 rows. use idisplaylength:70 in call .datatable. see jsfiddle, believe works how ask: http://jsfiddle.net/ptcdv/

the code need this:

var otable = $('#mytable').datatable({       aadata: data,     "alengthmenu": [[70, 175, 350, -1], [10, 25, 50, "all"]],     "idisplaylength": 70      }) 

without "idisplaylength", datatables shows 10 rows.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -