当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Search Not working in bootgrid

问题描述:

In My HTML I have this

<table id="data-table-command" class="table table-striped table-vmiddle">

<thead>

<tr>

<th data-column-id="Committee" data-identifier="true">Standing Committee</th>

<th data-column-id="Members">Number of Members</th>

<th data-column-id="Initate">Date Initiated</th>

<th data-column-id="State">State</th>

<th data-column-id="status" data-type="numeric" data-sortable="false" data-visible="false">status</th>

<th data-column-id="Session">Next Session</th>

<th data-column-id="Join" data-formatter="join-command" data-sortable="false">Join</th>

<th data-column-id="View" data-formatter="view-command" data-sortable="false">VIEW</th>

<th data-column-id="Delete" data-formatter="delete-command" data-sortable="false">Delete</th>

</tr>

</thead>

</table>

In My Javascript I did this below, though I am pulling my data from the server is there any extra settings I need to add that am missing in other to make the search work. and am using Require Js Hope that won't affect it because as you can see I load the bootgrid Library in the function

function loadbootgridAll() {

require(['bootgrid'], function (bootgrid) {

//Command Buttons

var grid_all = $("#data-table-command").bootgrid({

ajax: true,

post: function () {

return {

id: '21'

};

},

url: 'http://localhost/getall.php',

caseSensitive: false,

searchSettings: {

delay: 100,

characters: 3

},

css: {

icon: 'zmdi icon',

iconColumns: 'zmdi-view-module',

iconDown: 'zmdi-sort-amount-desc',

iconRefresh: 'zmdi-refresh',

iconUp: 'zmdi-sort-amount-asc'

},

formatters: {

"join-command": function (column, row) {

// console.log(column);

// console.log(row);

return "<a id=\"" + row.Committee + "\" class=\"btn btn-icon bgm-green command-join waves-effect waves-circle\"><span class=\"zmdi zmdi-plus\"></span></a> ";

},

"view-command": function (column, row) {

return "<a id=\"" + row.Committee + "\" class=\"btn btn-icon bgm-blue waves-effect command-view waves-circle\"><span class=\"zmdi zmdi-view-list\"></span></a> ";

},

"delete-command": function (column, row) {

return "<a id=\"" + row.Committee + "\" class=\"btn btn-icon bgm-red waves-effect command-delete waves-circle\"><span class=\"zmdi zmdi-delete\"></span></a> ";

},

}

})

My JSON DATA

{"current":1,"rowCount":10,"total":2,"rows":[{"Committee":"Budget","Members":"1","State":"active","Initate":"2016-11-25 12:16:09 pm","Session":"No Date","status":0},{"Committee":"Security","Members":"1","State":"pending","Initate":"2016-11-25 12:18:50 pm","Session":"No Date","status":2}]}

分享给朋友:
您可能感兴趣的文章:
随机阅读: