Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

datatable numbering

var table = $('#table').DataTable({
	data: data,
	columns: [
        {data: 'id', title: '#'}, //must have
    ],
  	columnDefs: [{
        sortable: false,
        class:    "index",
        targets:  0
    }],
    order: [[ 0, 'asc' ]],
})

table.on( 'order.dt search.dt', function () {
    table.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
      cell.innerHTML = i+1;
    });
}).draw();
Comment

PREVIOUS NEXT
Code Example
Javascript :: local storege in jquery 
Javascript :: debounchow use input debounce in javascript vue.js 
Javascript :: react hook form with yup resolver 
Javascript :: converting a string into a number in javascript 
Javascript :: syntax for srcset in react 
Javascript :: reactjs cdn 
Javascript :: sleeping in js 
Javascript :: javascript localstorage 
Javascript :: jquery force page to reload on viewport resize 
Javascript :: Get LocalStorage from WebView react native 
Javascript :: javascript if shorthand 
Javascript :: unary operator javascript 
Javascript :: fetch method in js 
Javascript :: particles js is not full screen 
Javascript :: django pass list to javascript 
Javascript :: ajax onchange dropdown 
Javascript :: localdatetime json 
Javascript :: regex valid url 
Javascript :: camelcase to normal text javascript 
Javascript :: Sort objects of objects by nested property 
Javascript :: react.fragment react native 
Javascript :: create empty array javascript 
Javascript :: get Two digit number js 
Javascript :: renemane object key js 
Javascript :: javascript determine if string is valid url 
Javascript :: node js sqlite3 
Javascript :: javascript canvas to image 
Javascript :: firebase where or 
Javascript :: To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect 
Javascript :: javascript tick marks 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =