Bootstrap Table Server Side With Coldfusion

Bootstrap Table Server Side With Coldfusion Component. Bootstrap Table is licensed under the The MIT License.

<!DOCTYPE html>
<html lang="en">
  <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <title>Meessage Broadcast Admin</title>
        <!-- Bootstrap core CSS -->
        <link href="../public/css/bootstrap.min.css" rel="stylesheet">
        <link href="../public/css/bootstrap-table.css" rel="stylesheet">
        <!-- Custom styles for this template -->
        <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
        <script type="text/javascript" src="../public/js/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="../public/js/bootstrap-table.js"></script>
  </head>
 

<div class="container"><br />
    <div class="row">
        <div class="page-header">
           <h1>Users</h1>
        </div>
        <div id="Error" class="text-danger"></div>
        <div class="col-sm-12 col-md-12 col-lg-12">
            <table id="users" data-height="400" data-side-pagination="server"
               data-pagination="true" data-search="true" data-toolbar="#Error">
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(e) {
    $('#users').bootstrapTable({
            method: 'get',
            url: 'cfc/users.cfc?method=getUsers',
            cache: false,
            height: 400,
            striped: true,
            pagination: true,
            pageSize: 10,
            pageList: [10, 25, 50, 100, 200],
            search: true,
            /*showColumns: true,*/
            showRefresh: true,
            minimumCountColumns: 2,
            clickToSelect: true,
            columns: [
          {field: 'Count',title: 'SNO',align: 'right',
            valign: 'bottom',sortable: false},
          {field: 'userid',title: 'Client ID',visible:false},
          {field: 'clientName',title: 'Client Name',align: 'center',
            valign: 'middle',sortable: true},
          {field: 'userName',title: 'User Name',align: 'left',
            valign: 'top',sortable: true},
          {field: 'operate',title: 'Actions',align: 'center',valign: 'middle',
          clickToSelect: false,formatter: operateFormatter,events: operateEvents}]
        });
    });
   
    function operateFormatter(value, row, index) {
        return [
            '<a class="edit ml10" href="javascript:void(0)" title="Edit">',
                '<i class="glyphicon glyphicon-edit"></i>',
            '</a>&nbsp;',
            '<a class="remove ml10" href="javascript:void(0)" title="Remove">',
                '<i class="glyphicon glyphicon-remove"></i>',
            '</a>'
        ].join('');
    }
   
    window.operateEvents = {
        'click .edit': function (e, value, row, index) {
            console.log(row);
        },
        'click .remove': function (e, value, row, index) {
            $.getJSON('cfc/users.cfc?method=deleteReport&returnformat=json
              &queryformat=column&_cf_nodebug=true
              &_cf_nocache=true&ReportID='+row.id_int,
            function(d)
            {
                $('#Error).text(d.MESSAGE);
                $('#users').bootstrapTable('refresh');
            });       
        }
    };   
</script>

More Details Visit  :
https://www.elearn99.com/programming/bootstrap-table-server-side-coldfusion/240/


Comments

Popular posts from this blog

Login with facebook using coldfusion

Create CSV file in Coldfusion Using CFFile

Get Previous One Day Data in Sql Server