Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Datatable with static json data source

$(document).ready(function(){
    var jsonData = [{"userID":"1","userName":"name1"},{"userID":"2","userName":"name2"},{"userID":"3","userName":"name3"}];
    $('#example').dataTable({
        data: jsonData,
        columns: [
            { data: 'userID' },
            { data: 'userName' }
        ]
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Datatable #static #json #data #source
ADD COMMENT
Topic
Name
6+5 =