lengthMenu -1 isn't working for me, using oracle database.
lengthMenu -1 isn't working for me, using oracle database.
jwen11
Posts: 4Questions: 1Answers: 0
serverSide: true,
ordering: false,
searching: true,
serverMethod: 'post',
lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ],
What might be the prob.?
This question has an accepted answers - jump to answer
Answers
You will need to debug your server script to find the problem.
lengthMenu
-1 means all rows. Your server script is expected to return all the rows. Are you using a Datatables supplied server side processing script or your own?Kevin
hi Kevin,
I think I am.
trying to log data result.
{draw: 2, columns: Array(11), order: Array(0), start: 0, length: -1, …}
{draw: 2, recordsTotal: 188, recordsFiltered: 188, data: Array(0)}
is this normal when trying to show all? length: -1
Not sure what you are. referring to. If its the Datatables script question let us knwo which script you are using.
Your server script is not returning any rows. You probably need to add a check for
length: -1
so that you don't add a where condition.If you only have 188 records in the table then you don't need server side processing. Turing off server side processing will make everything easier.
Kevin
@kthorngren i mean yes im using Datatables script.
but when im going to
show [100] entries
it will display 100 rowsand trying to
show [All] entries
it says "No matching records found"im just testing it using server side processing cuz this will populate soon.
Which DataTables script are you using? We only provide Oracle support for our Editor libraries and they should work okay with the
-1
(show all) option.Basically, wherever in the script the
limit
andoffset
are being applied, that should only be applied if the length list is not -1.Allan
@allan
1.10.21.
Thanks by the way.
maybe I need to figure this out. why..
Have a look at whatever server-side script you are using (you didn't say which one, or if it is custom made) and look at how it is applying the
LIMIT
andOFFSET
. That's the key part for this question.Allan