How to show less than 10 rows??
How to show less than 10 rows??
cris_mf
Posts: 5Questions: 2Answers: 0
Hello, I try to show 5 rows per page, but i can't.
I try :
pageLength: 5
lengthMenu: [[5, 10, 20, -1], [5, 10, 20, "Todos"]]
but don´t work.
I think that I need a extra function but I don´t know. Please help me. Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi cris_mf,
Thank you for the question. I just tried this on http://live.datatables.net/dutabeye/1/edit, an easy to use sandpit for trying these things out, and it seems to do what you're after
However, since it looks the same as what you sent across, can you give your setup a try there and see if it works. If not, please send across your DataTable code and we'll take a look.
Cheers,
Colin
Hi Colin,
Thank you for response me. I tried your solution but it doesn't work.
This is my code:
Hi again cris_mf,
It looks like the problem is because you've put the
pageLength
andlengthMenu
inside thecolumnDefs
options block. I suspect if you move it to the top then that should solve your problem.On a different note, your
language
option isn't formatted correctly - this doesn't specify the spoken language as you have it, it defines language properties such as the thousand separator. See the link above for more information.Cheers,
Colin
Thanks!!!
And sorry, you can see that I am beginner.
'spanish' is a variable, I think this way my code is more clean.
var spanish ={"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar MENU registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del START al END de un total de TOTAL registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de MAX registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate": {
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria": {
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
}
I hope you understand me, my english isn't that good.
Thank you!!
Regards
Excellent! Glad it's working. I'm a beginner too, this was my first support case!!! 100% happy customers so far