JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://www.jtable.org/Scripts/jtable/themes/metro/blue/jtable.css">
<script src="http://www.jtable.org/Scripts/jtable/jquery.jtable.js"></script>
<div id="journal" class="tablecontainer" style="width:100%; height:300px; " ></div>
CSS
.scroll-content {
overflow-y: auto;
width:100%;
}
div.jtable-main-container {
height:100%;
}
JavaScript
$('#journal').jtable({
title: 'Korrespondance',
paging: false, //Enable paging
pageList: 'minimal',
gotoPageArea: 'none',
pageSizes: [3, 5, 10, 100],
pageSize: 3,
sorting: false, //Enable sorting
defaultSorting: 'CreationTime DESC',
actions: {
listAction: '/buu'
},
fields: {
ID: {
key: true,
create: false,
edit: false,
list: false
},
BorgerID: {
type: 'hidden',
defaultValue: 111
},
Message: {
title: "Besked",
create: false,
edit: false,
list: true,
width: '70%',
display: function (data) {
return "<b>" + data.record.Title + "</b><br/>" + data.record.Content;
}
},
RecieverOption: {
title: "Synlig for",
create: true,
list: true
},
Title: {
title: 'Overskrift',
list: false
},
CreationUser: {
title: 'Oprettet af',
create: false,
edit: false,
width: '10%'
},
CreationTime: {
title: 'Dato',
edit: false,
create: false
},
Content: {
title: 'Besked',
list: false,
type: 'textarea'
}
}
});
$(function(){
$('.jtable').wrap('<div class="jtable-main-container scroll-content" />');
for (var i = 0; i < 10; i++) {
$('#journal').jtable('addRecord', {
record:{
ID:i,
BorgerID:0,
CreationTime:"1-10-2013",
Title:"zsdfg",
Content:"xfdgh",
RecieverOption:2,
Visibility:null,
CreationUser:"Pedro Pedroson"},
clientOnly :true
});
}
});