tabbed plugin example
by blenson
HTML
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.office.css">
<div class="ssWidgetWrapper" style="width:700px">
<div class="ssWidgetHeading">Empty Version Status</div>
<div id="ssEmptyVersionWidget" class="ssWidget"></div>
</div>
<div class="ssWidgetWrapper" style="width:700px">
<div class="ssWidgetHeading">Version Status</div>
<div id="ssDashVersionWidget" class="ssWidget"></div>
</div>
CSS
.ssWidgetWrapper {
background-color: white;
color: black;
width: 65%;
margin: 0;
padding: 20px;
}
.ssWidgetHeading {
background-color: white;
color: #656565;
width: 100%;
margin: 5px 0 5px 0;
padding-left: 10px;
padding-bottom: 3px;
font-family: 'Helvetica', sans-serif;
font-size: 1.5em;
font-weight: 900;
border-style: solid;
border-width: 2px;
border-bottom-color: #656565;
border-left-color: white;
border-right-color: white;
border-top-color: white;
}
.ssStatusWidgetIcon {
padding-top: 3px;
width: 45px;
height: 45px
}
.ssStatusWidgetServerBar {
height: 35px
}
.ssStatusWidget td {
padding-left: 10px;
padding-right: 10px;
color: #656565;
font-family: 'Helvetica', sans-serif;
font-size: 1em;
font-weight: 700;
height: 50px;
}
.ssStatusWidget span {
font-family: 'Helvetica', sans-serif;
font-size: 1em;
font-weight: 600;
}
.ssWidget td {
padding-left: 10px;
padding-right: 10px;
color: #656565;
font-family: 'Helvetica', sans-serif;
font-size: 1em;
font-weight: 700;
}
.ssWidget span {
font-family: 'Helvetica', sans-serif;
font-size: 1em;
font-weight: 600;
}
.ssStatusDrilldownButton {
background-color: white;
vertical-align: top;
font-size: 3em !important;
line-height: 25px;
padding-bottom: 13px;
}
.ssDrilldownButton {
background-color: white;
font-size: 3em !important;
line-height: 25px;
padding-bottom: 13px;
}
JavaScript
(function($) {
// locals
var PLUGIN = 'ssTabbedBarList';
var PLUGINDATA = 'plData';
var PLUGINROWDATA = 'plRowData';
var PLUGINROWCB = 'plRowCallBack';
var valDefaults = {
id: null,
val: null
};
var rowDefaults = {
tag: null,
label: null,
visible: null,
vals: []
};
var tabDefaults = {
tag: null,
label: null,
emptyText: 'No data to display.',
onclick: null,
rows: []
};
var ctlDefaults = {
height: '40px',
onclick: null,
tabs: []
};
var barDefaultSettings = {
title: "",
description: "",
borderLineWidth: 0,
enableAnimations: false,
greyScale: true,
showLegend: true,
showToolTips: false,
rtl: false,
padding: {
left: 5,
top: 5,
right: 5,
bottom: 5
},
titlePadding: {
left: 90,
top: 0,
right: 0,
bottom: 10
},
xAxis: {
dataField: null,
formatFunction: function(value, itemIndex, serie, group) {
return ' ';
},
showTickMarks: false,
showGridLines: false,
axisSize: 'auto'
},
valueAxis: {
unitInterval: 0,
formatFunction: function(value, itemIndex, serie, group) {
return ' ';
},
showTickMarks: false,
showGridLines: false,
},
colorScheme: 'scheme03',
};
var _draw = function(ctl) {
var ctlSel = ctl.selector.split('#')[1];
var settings = ctl.data(PLUGINDATA);
var click = settings['onclick'];
var tabs = settings['tabs'];
var tabCount = 0;
var tabId = ctlSel + '_tab';
ctl.html('<div id="' + tabId + '" style="width: 100%" ></div>');
var tabCtl = $('#' + tabId);
if (tabs != null) {
tabCount = tabs.length;
}
// set up the tab labels
var tabsUL = '<ul...