Hi Guys,
I'm not that good in Javascript. Can you please help me in putting the required changes for client pagination into the below code?
My code is as below.
<script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
var JSONurl = '/tmp/vta.json'; // Input data
var myTitle = 'Monitor Screen';
$('#dg').datagrid({
url:JSONurl,
pageSize: 30,
pagination: true,
rownumbers: true,
singleSelect: true, // So Users can select one alert at a time
remoteSort: false,
title: myTitle,
rowStyler:function(index,row){ // ROW Colouring
if (row.severity == '0'){ // GOOD level
return 'background-color:#58FA82;';
}
else if (row.severity == '4'){ // WARNING level
return 'background-color:#FBB870;';
}
else if (row.severity == '5'){ // CRITICAL level
return 'background-color:#FF7684;';
}
},
columns:[[
{field:'ID',title:'ID',width:45, sortable:true},
{field:'start_time',title:'Start_time',width:100, sortable:true},
{field:'team',title:'team',width:180, sortable:true},
{field:'last_update',title:'Last_update',width:100, sortable:true},
{field:'details',title:'Details',width:260, sortable:true},
{field:'severity',title:'severity',width:40, sortable:true}
]]
});
// Function to reload grid every x seconds
// This will ensure no rotating icons are shown. Gives a seamless effect
$(function() {
$('#dg').datagrid({loadMsg:''});
function grid_refresh() {
$('#dg').datagrid('reload');
setTimeout(grid_refresh, 120000);
}
grid_refresh();
});
</script>
The html call is done as
<table id="dg" toolbar="#toolbar" style="height:720px;" fit="true" sortName="start_time" sortOrder="desc"></table>
Any help would be appreciated.
Cheers