jqxlayout and angular
asdf
HTML
<link rel="stylesheet" href="http://www.jqwidgets.com/jquery-widgets-demo/jqwidgets/styles/jqx.base.css">
<script src="http://www.jqwidgets.com/jquery-widgets-demo/scripts/angular.min.js"></script>
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div ng-app="app">
<div ng-controller="mainCtrl as main">
<!--
<jqx-grid jqx-settings="gridSettings"></jqx-grid>
-->
<jqx-layout jqx-settings="layoutSettings">
<div data-container="Content1">
<jqx-grid jqx-settings="gridSettings"></jqx-grid>
</div>
<div data-container="Content2">
<p>
Different content.
</p>
</div>
</jqx-layout>
</div>
</div>
TypeScript
angular.module("app", ["jqwidgets"]).controller("mainCtrl", function($scope) {
// layout
var layout = [{
type: 'layoutGroup',
orientation: 'horizontal',
items: [
{
type: 'documentGroup',
width: "100%",
height: "100%",
contentContainer: 'AppbarGroup',
items: [{
type: 'documentPanel',
title: '1',
width: "50%",
height: "100%",
contentContainer: 'Content1'
initContent: function() {
// should I do something here?
}
}, {
type: 'documentPanel',
title: '2',
width: "50%",
height: "100%",
contentContainer: 'Content2'
}]
}
]
}];
$scope.layoutSettings = {width: "100%", height: "100%", layout: layout};
// grid
var source =
{
localdata: [
["Alfreds Futterkiste", "Maria Anders"],
["Ana Trujillo Emparedados y helados", "Ana Trujillo"],
["Antonio Moreno Taquera", "Antonio Moreno"],
["Around the Horn", "Thomas Hardy"],
["Berglunds snabbkp", "Christina Berglund"]
],
datafields: [
{ name: 'CompanyName', type: 'string', map: '0'},
{ name: 'ContactName', type: 'string', map: '1' },
],
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source);
$scope.gridSettings =
{
width: 850,
source: dataAdapter,
columns: [
{ text: 'Company Name', datafield: 'CompanyName', width: 200 },
{ text: 'Contact Name', datafield: 'ContactName', width: 150 },
]
});
});