<title>Bootstrap 4 Table</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://unpkg.com/gijgo@1.9.14/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.14/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<div class="container-fluid">
<form class="form-inline">
<input id="txtName" type="text" placeholder="Name..." class="form-control mb-2 mr-sm-2 mb-sm-0" />
<input id="txtPlaceOfBirth" type="text" placeholder="Place Of Birth..." class="form-control mb-2 mr-sm-2 mb-sm-0" />
<button id="btnSearch" type="button" class="btn btn-default">Search</button>
<button id="btnClear" type="button" class="btn btn-default">Clear</button>
<button id="btnAdd" type="button" class="btn btn-default pull-right">Add New Record</button>
<div class="row" style="margin-top: 10px">
<table id="grid"></table>
<div id="dialog" style="display: none">
<input type="hidden" id="ID" />
<label for="Name">Name</label>
<input type="text" class="form-control" id="Name">
<label for="PlaceOfBirth">Place Of Birth</label>
<input type="text" class="form-control" id="PlaceOfBirth" />
<button type="button" id="btnSave" class="btn btn-default">Save</button>
<button type="button" id="btnCancel" class="btn btn-default">Cancel</button>
<script type="text/javascript">
$('#Name').val(e.data.record.Name);
$('#PlaceOfBirth').val(e.data.record.PlaceOfBirth);
dialog.open('Edit Player');
PlaceOfBirth: $('#PlaceOfBirth').val()
$.ajax({ url: '/Players/Save', data: { record: record }, method: 'POST' })
alert('Failed to save.');
if (confirm('Are you sure?')) {
$.ajax({ url: '/Players/Delete', data: { id: e.data.id }, method: 'POST' })
alert('Failed to delete.');
$(document).ready(function () {
dataSource: '/Players/Get',
{ field: 'ID', width: 48 },
{ field: 'Name', sortable: true },
{ field: 'PlaceOfBirth', title: 'Place Of Birth', sortable: true },
{ title: '', field: 'Edit', width: 42, type: 'icon', icon: 'fa fa-pencil', tooltip: 'Edit', events: { 'click': Edit } },
{ title: '', field: 'Delete', width: 42, type: 'icon', icon: 'fa fa-remove', tooltip: 'Delete', events: { 'click': Delete } }
pager: { limit: 5, sizes: [2, 5, 10, 20] }
dialog = $('#dialog').dialog({
iconsLibrary: 'fontawesome',
$('#btnAdd').on('click', function () {
$('#PlaceOfBirth').val('');
dialog.open('Add Player');
$('#btnSave').on('click', Save);
$('#btnCancel').on('click', function () {
$('#btnSearch').on('click', function () {
grid.reload({ name: $('#txtName').val(), placeOfBirth: $('#txtPlaceOfBirth').val() });
$('#btnClear').on('click', function () {
$('#txtPlaceOfBirth').val('');
grid.reload({ name: '', placeOfBirth: '' });