How to get searchList selected values on serverside

How to get searchList selected values on serverside

btorkbtork Posts: 5Questions: 1Answers: 0

I'm using serverside processing for a large dataset. I have search enabled on all columns and a few of them have searchList option enabled. How do I get the multiple values selected on the server side so I can filter the results? I'm using .NET MVC.

Thanks-
btork

Answers

  • allanallan Posts: 64,552Questions: 1Answers: 10,670 Site admin

    Hi btork,

    I'm afraid that at the moment server-side processing is not yet supported for the filter features of ColumnControl. There is information about this in the manual.

    Allan

  • btorkbtork Posts: 5Questions: 1Answers: 0

    Got it, understood. That being said, I would prefer to use client side but my dataset is about 30,000 records with 10 columns. Any idea why it won't load client side? Am I hitting a size threshold somewhere?

  • kthorngrenkthorngren Posts: 22,030Questions: 26Answers: 5,082

    Any idea why it won't load client side?

    There is nothing in Datatables that limits the data received from the server. With 30,000 records is the loading slow or does it not finish loading? If not finishing then look for errors in the console and use the browser's network inspector to view the JSON response.

    Kevin

  • btorkbtork Posts: 5Questions: 1Answers: 0

    How can I call my controller to get the data initially without using serverSide: true? I want to use client side but I need to get the data from the controller. Here is my ajax property, but if I don't use serverside then it never loads the data.

    "ajax": {
                "type": "GET",
                "url": "/Home/GetInventoryAjax",
                "dataSrc": "Records"
            },
    
  • allanallan Posts: 64,552Questions: 1Answers: 10,670 Site admin

    If you look at the browser's network inspector, what happens to that Ajax request? Does it immediately show an error, or does it take a long time and then result in an error, or perhaps the whole page hangs?

    30k records is certainly on the cusp of needing server-side processing and if each record is fairly large, you might be transferring a fair amount of data.

    Allan

  • btorkbtork Posts: 5Questions: 1Answers: 0

    I get the following error.

    Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
    
  • kthorngrenkthorngren Posts: 22,030Questions: 26Answers: 5,082

    Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

    This SO thread is one of the results by google searching the error. Hope the answers in the thread help.

    Kevin

  • btorkbtork Posts: 5Questions: 1Answers: 0

    Thanks Kevin. This line a code solved the json string length issue for me.

    return new JsonResult() { Data = dataTableData, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue };
    
Sign In or Register to comment.