Trying to load once via ajax from server and then sort and filter on client side.

Trying to load once via ajax from server and then sort and filter on client side.

RobbSadlerRobbSadler Posts: 5Questions: 0Answers: 0
edited April 2014 in General
I am trying to get my data from the server via ajax one time and then use client side sorting, filtering, etc.

I thought this would accomplish that, but it only pulls data if I have bServerSide set to true:

[code]
$(document).ready(function () {

var oTable = $('#dataTableAccountList').dataTable({
"bServerSide": false,
"bDeferRender": true,
"sAjaxSource": '/AccountList/GetData'
});

$('.dataTables_length select').uniform();
$('.dataTables_paginate > ul').addClass('pagination');
});

[/code]

If I set it to true I get the data, if I set it to false I get "No data available in table"

Guessing that I am missing something simple. The page is not yet published, but if you need me to get something out there then I will put it together.

Thanks!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    What is being returned by the server if you have the bServerSide parameter set to false? It should be returning the entire data set, but from your description, I'm guessing its returning an empty data set?

    Allan
  • RobbSadlerRobbSadler Posts: 5Questions: 0Answers: 0
    It was something simple. The iDisplayLength parameter was being tested for -1, but was being handed a 0. The ajax handler was expecting pagination parms and when the query asked for 0 records, that's what it got back. Thanks!
This discussion has been closed.