Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery datatable destroy and recreate

  $("#Table").DataTable().clear().destroy();
            $("#Table").dataTable({
                "sAjaxSource": '@Url.Action("YourMethod", "UrCOntrollerName")',
                "bServerSide": true,
                "bProcessing": false,
                "searching" : false,

                "columns": [
                    {
                        "data": "ID",
                        "autoWidth": true,
                        "searchable": false,
                        "mRender": function (arqs, type, data) {
                            return "<a href='#' onclick='RemoveCombine(this)' data-id='" + data.ID + "'  class='btn-round-sm' title='Remove' style='padding: 5px 5px 5px 5px;'><span>Remove</span></a>";
                        }
                    },
Comment

datatable destroy

jQuery("#LableDatatable").DataTable( {
  destroy: true, // add this line to distory 
  responsive: true,
  "ajax": {
  "url": url,
  "type": 'GET',
  "data": data
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery merge objects 
Javascript :: pick random from array 
Javascript :: remove null and undefined from array 
Javascript :: get keys wher value is true in object in javascript 
Javascript :: jquery page finished loading 
Javascript :: filter array of objects to remove duplicate keys 
Javascript :: update an item in array of object 
Javascript :: javascript get file extension from string 
Javascript :: typescript filter array of objects 
Javascript :: falsy values in array 
Javascript :: add commas to a number javascript 
Javascript :: javascript add element next to another 
Javascript :: json data doesn show on console 
Javascript :: jquery ajax while loading 
Javascript :: Clear Cell Value In Google Sheet By App Scripts 
Javascript :: noise margin in digital electronics 
Javascript :: string to ascii javascript 
Javascript :: javascript get unique values from key 
Javascript :: js scrollintoview 
Javascript :: TypeError: getComputedStyle(...).getPropertyValue is not a function 
Javascript :: how to negate a boolena variable javascript 
Javascript :: node json db example 
Javascript :: js check if date is future 
Javascript :: spacebar event listener 
Javascript :: html javascript call function after pressing enter 
Javascript :: cross-origin request blocked the same origin policy disallows reading the remote resource fix in node js node js 
Javascript :: google maps init map 
Javascript :: js minifier api 
Javascript :: javascript setattribute 
Javascript :: loop key in object 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =