Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

reload data after clicking button

$
0
0
I load data by default like this

$('.datatable').dataTable({
        "sPaginationType": "bs_full",
        "bProcessing" : true,
        "sAjaxSource" : "loadusers.html",
        "sAjaxDataProp" : "test"
    });

My table on html page looks like this
<table class="datatable table table-striped table-bordered" id="usertable">
                     <thead>
                        <th>Name</th>
                        <th>Surname</th>
                        <th>Username</th>
                    </thead>
                    <tbody>
                    </tbody>
                </table>


Server answer looks like this
 return "{ \"test\": [ "
                + "[ \"name1\", \"surname1\", \"username1\"],"
                + "[ \"name2\", \"surname2\", \"username3\"],"
                + "[ \"name2\", \"surname2\", \"username3\"]"
                + "] }"; 


But how to load data by clicking button on the page? For example by clicking button
<button id="button1" class="btn btn-primary">Clicker</button>

Viewing all articles
Browse latest Browse all 1816

Trending Articles