JavaScript JQuery DataTable set default empty search Echo parameter jquery datatable default sort,jquery datatable default page length,jquery

I'm using JQuery DataTable with server side processing. And I've written this code:

public List<VacationRequest> GetVacationRequestsWithProfiles(int displayStart, int displayLength, out int allDataCount, out int filteredDatacount, string searchParam = "", string searchDir = "")
{
....

    switch(searchDir)
                {
                    case "asc":
                        requests = requests.OrderBy(x => x.FirstName).ThenByDescending(x=>x.DateEnd).Skip(displayStart).Take(displayLength);
                        break;
                    case "desc":
                    requests = requests.OrderByDescending(x => x.FirstName).ThenByDescending(x=>x.DateEnd).Skip(displayStart).Take(displayLength);
                        break;
                    default:
                        requests = requests.OrderBy(x=>x.VacationRequestState).ThenByDescending(x=>x.DateEnd).Skip(displayStart).Take(displayLength);
                        break;
                }

....
}

The problem: I need to get default (empty) search parameter to this method, when page loaded. How I may resolve this? This is a part of JS code:

  "aoColumns": [
    { "data": "ID", "visible": false, bSortable: false, bSearchable: false },
    { "data": "Name" },
    {
        "data": "VacationRequestStatus",
        bSortable: false,
        bSearchable: false,
        "mRender": function (data, type, full) {              
            return '<div class = "' + data + '"> <span class="glyphicon glyphicon-question-sign requested-img"></span> <span class="glyphicon glyphicon-ok accept-img"> </span> <span class="glyphicon glyphicon-remove decline-img"></span> </div>';
        }
    },
    { "mData": "Position", bSortable: false, bSearchable: false },
    { "mData": "DateStart", bSortable: false, bSearchable: false },
    { "mData": "DateEnd", bSortable: false, bSearchable: false },
    {
        bSortable: false,
        bSearchable: false,
        data: null,
        className: "center",
        defaultContent: '<button class="btn btn-danger decline-button">Decline</button> <button class="btn btn-primary accept-button">Accept</button>'
    }
    ]
Answer:1

I'm trying to integrate a React application (using react-router) into an existing Angular website. I've wrapped the React app up in an Angular directive which loads scripts and renders the React app ...

I'm trying to integrate a React application (using react-router) into an existing Angular website. I've wrapped the React app up in an Angular directive which loads scripts and renders the React app ...

I'm getting Model not defined error with below code. I've added underscore, jquery, backbone etc but I can only get object returned with console.log function for jquery only $ Is there a reason why ...

I'm getting Model not defined error with below code. I've added underscore, jquery, backbone etc but I can only get object returned with console.log function for jquery only $ Is there a reason why ...

I'm trying to set up a tabbed navigation bar but it's not hiding the content from the other tabs. On a similar note, creating a new page doesn't work in the same way. It shows the content of the ...

I'm trying to set up a tabbed navigation bar but it's not hiding the content from the other tabs. On a similar note, creating a new page doesn't work in the same way. It shows the content of the ...

  1. jquery mobile tabs swipe
  2. jquery mobile tabs example
  3. jquery mobile tabs default active
  4. jquery mobile tabs
  5. jquery mobile tabs not working
  6. jquery mobile tabs active
  7. jquery mobile tabs w3schools
  8. jquery mobile tabs menu swipe
  9. jquery mobile tabs events
  10. jquery mobile scrollable tabs
  11. jquery mobile navbar tabs example
  12. jquery ui tabs mobile
  13. jquery mobile horizontal scroll tabs

I've got a content-editable <div>. When a correct markdown syntax is entered into the div, I need it to add the correct HTML around the outside, but preserve the markdown characters within. For ...

I've got a content-editable <div>. When a correct markdown syntax is entered into the div, I need it to add the correct HTML around the outside, but preserve the markdown characters within. For ...