Combine selector-modifier with a function
Combine selector-modifier with a function
th3monk3y
Posts: 6Questions: 1Answers: 0
The following code works, but only returns the first page. I would like to combine the modifier selector { "page" : "all" } but can't seem to figure it out. Any help would be appreciated.
The code selects rows with checkbox checked. but only returns current page. I'd like to return all pages hidden or not.
var rowcollection = oTable
.rows(function (idx, data, node) {
return $(node).find($(".asin-check")).is(':checked') ? true : false;
})
.data();
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
anyone?
The
page: 'all'
option is the default, which suggests to me that you are using server-side processing (although its impossible to say without more information). If you are using server-side processing, this it is working as expected since this is a client-side function and only the data for the current page is available at the client side. If you are not using server-side processing, please link to a test case showing the issue.Allan
Hi Allan, thanks for your reply.
I am not using server side processing. I am using Ajax pulling Json from a .NET Web API
Data is populating fine. The only checked rows being picked up are on the current page, regardless of page number
Here is my table code. fairly vanilla. "I think?"
}
Forgot to mention. Using DataTables version 1.10.4
It would be worth updating to the current release and trying that, but I ca#n't recall any bugs that would cause this.
Can you link to a test case showing the issue so I can debug it please.
Allan
Thanks again for your help. I found the offending line of code. By removing it, I was able to return all rows. I am going to play with it.
and here it is in context.
Maybe someone can spot the problem straight away.
this is selected from the document only - i.e. the visible rows, since jQuery knows nothing about DataTables' hidden rows.
Can you simply use:
Allan
oh man! I can't believe I didn't see that! Blaring when you know what it is.
Thanks Allan, problem solved!