c# - wenzhixin bootstrap-table doesn't return any results with server size pageination -
i'm trying implement bootstrap table in code , i'm having worst time it. results until add line sidepagination: 'server'. nothing. code
@using (html.beginform()) { <table id="itemstable"></table> } @section scripts { <script> $(document).ready(function () { $("#itemstable").bootstraptable({ url: '/tests/data', method: 'get', queryparamstype: 'else', pageination: 'true', pagesize: 10, sidepagination: 'server', pagelist: '[10, 25, 50, 100, 200]', columns: [ { field: 'campaignname', title: 'campaignname', sortable: true } ] }); }); </script> }
server side code
// get: tests public actionresult index() { return view(); } public jsonresult data(int? pagesize, int? pagenumber, string sortorder) { var list = _campaignrepository.getall().select(x => new { x.campaignname }).tolist(); jsonresult results = json(list, jsonrequestbehavior.allowget); return results; }
i've spent 2 days monkeying table. please, experience, manner of or direction appreciated.
[updated below answer]
i have similar issue whenever server-side pagination specified in options (obligatory code reference allow jsfiddle reference):
sidepagination: 'server'
see https://jsfiddle.net/m8e2kk6d/ concrete example , https://github.com/wenzhixin/bootstrap-table/issues/1281 issue have raised.
cheers, daniel
--
update 13/aug/15:
the issues server-side pagination requires different server response format:
{ total: 100, rows: [] }
Comments
Post a Comment