mardi 1 mai 2018

advanced web table with pagination and search and column selection

I want to display a table in a web app where I want to be able to select the columns to display, and perform pagination and sorting with the server back end. I've tried using bootstrap-table. I cannot figure out how to load the data in it using a url or ajax. Here is the documentation. and here is what I tried:

<html>
<head>
<link rel="stylesheet" href="./bootstrap-table.min.css">
<link rel="stylesheet" href="./bootstrap-3.3.7/css/bootstrap.min.css">
<script src="./jquery-2.1.0.js"></script>
<script src="./popper.js"></script>
<script src="./bootstrap-3.3.7/js/bootstrap.min.js"></script>
<script src="./bootstrap-table.min.js"></script>
</head>
<body>
    <table border="2"
        data-toggle="table"
        data-show-columns="true"
        data-striped="true"
        data-search="true"
        data-query-params="queryParams"
        data-pagination="true"
        data-height="300"
        url: "http://192.168.168.17:8000/get_data"
        data-classes="table table-hover">
    </table>
</body>

Am I supposed to return a json dictionary from the server where the keys map to the headers which are not defined in the example above? How can I pass the pagination info and the search info? The documentation is not helpful at all. I'm also open to using another library.




Aucun commentaire:

Enregistrer un commentaire