Javascript/jQuery UI Widgets
Show Demo List
<script type="text/javascript" src="jquery.js"></script>In the AngularJS app definition, pass the jqwidgets module dependency:<script type="text/javascript" src="angular.js"></script><script type="text/javascript" src="jqxcore.js"></script><script type="text/javascript" src="jqxangular.js"></script>
var app = angular.module("app", ["jqwidgets"]);
<jqx-button></jqx-button>Example:
<!DOCTYPE><html ng-app="demoApp"><head><title>Button directive from attribute for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {});</script></head><body><div ng-controller="demoController"><jqx-button></jqx-button></div></body></html>
<button jqx-button>Button</button>or data-prefixed
<button data-jqx-button>Button</button>Example:
<!DOCTYPE><html ng-app="demoApp"><head><title>Button directive from attribute for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {});</script></head><body><div ng-controller="demoController"><button jqx-button>Button</button></div></body></html>
<button id="button"></button><script type="text/javascript">$("#button").jqxButton();</script>
<jqx-grid jqx-columns="columns" jqx-source="people" jqx-width="700" jqx-alt-rows="true"></jqx-grid>The "jqx-source" attribute is a special attribute which can be used for setting the widget's data source to an object or property defined in the Controller.
<script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {// Grid data.$scope.people = [{id: 1,name: "Pedro",age: 13}, {id: 2,name: "Clara",age: 22}, {id: 3,name: "John",age: 33}, {id: 4,name: "Pier",age: 27}];$scope.settings ={altrows: true,width: 500,height: 300,source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }]}});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-settings="settings"></jqx-grid></div></body></html>
<!DOCTYPE html>For automatic refreshes, you can add the "jqx-watch-settings" attribute to your HTML Element. By doing that the plugin will watch for changes in the settings object and will refresh the widget if necessary.<html ng-app="demoApp"><head><title id="Description">jqxComboBox directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {var data = new Array();var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"];var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"];for (var i = 0; i < firstNames.length; i++) {var row = {};row["label"] = firstNames[i];row["value"] = lastNames[i];data[i] = row;}$scope.comboBoxSettings = {source: data, itemHeight: 50, height: 25, width: 220,renderer: function (index, label, value) {var datarecord = data[index];var imgurl = '../../images/' + label.toLowerCase() + '.png';var img = '<img height="30" width="25" src="' + imgurl + '"/>';var table = '<table style="color: inherit; font-size: inherit; font-style: inherit;"><tr><td style="width: 35px;">' + img + '</td><td>' + label + " " + value + '</td></tr></table>';return table;},renderSelectedItem: function (index, item) {return item.label + " " + item.value;}};$scope.click = function () {$scope.comboBoxSettings.width = 300;$scope.comboBoxSettings.height = 40;// refresh the width and height widget properties.$scope.comboBoxSettings.refresh(['width', 'height']);// If you call it without arguments, all defined settings in the comboBoxSettings object will by synchronized with the widget.// $scope.comboBoxSettings.refresh();};$scope.apply = function () {// call apply to select the index.$scope.comboBoxSettings.apply('selectIndex', 4);// The above is equal to:// $scope.comboBoxSettings.jqxComboBox('selectIndex', 4);//}$scope.selectedValue = data[0];});</script></head><body><div ng-controller="demoController"><jqx-combo-box ng-model="selectedValue" jqx-ng-model jqx-settings="comboBoxSettings"></jqx-combo-box><br /><br />Selected: {{selectedValue.label + " " + selectedValue.value}}<br /><jqx-button ng-click="click()">Set Width and Height</jqx-button><jqx-button ng-click="apply()">Call Method</jqx-button></div></body></html>
<!DOCTYPE html><html ng-app="demoApp"><head><title id="Description">jqxComboBox directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {var data = new Array();var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"];var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"];for (var i = 0; i < firstNames.length; i++) {var row = {};row["label"] = firstNames[i];row["value"] = lastNames[i];data[i] = row;}$scope.comboBoxSettings = {source: data, itemHeight: 50, height: 25, width: 220,renderer: function (index, label, value) {var datarecord = data[index];var imgurl = '../../images/' + label.toLowerCase() + '.png';var img = '<img height="30" width="25" src="' + imgurl + '"/>';var table = '<table style="color: inherit; font-size: inherit; font-style: inherit;"><tr><td style="width: 35px;">' + img + '</td><td>' + label + " " + value + '</td></tr></table>';return table;},renderSelectedItem: function (index, item) {return item.label + " " + item.value;}};$scope.click = function () {$scope.comboBoxSettings.width = 300;$scope.comboBoxSettings.height = 40;};$scope.selectedValue = data[0];});</script></head><body><div ng-controller="demoController"><jqx-combo-box ng-model="selectedValue" jqx-watch-settings jqx-ng-model jqx-settings="comboBoxSettings"></jqx-combo-box><br /><br />Selected: {{selectedValue.label + " " + selectedValue.value}}<br /><jqx-button ng-click="click()">Set Width and Height</jqx-button></div></body></html>
<!DOCTYPE html>The "jqx-create" attribute can be used for creating the widget on demand or with some delay. For example, you may want the widget to be created after some other action like when an Ajax call is completed or when the widget's settings object is available.<html ng-app="demoApp"><head><title id="Description">jqxChart directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdraw.js"></script><script type="text/javascript" src="../../jqwidgets/jqxchart.core.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {var dataAdapter = new $.jqx.dataAdapter( {datatype: "csv",datafields: [{ name: 'Country' },{ name: 'GDP' },{ name: 'DebtPercent' },{ name: 'Debt' }],url: '../../sampledata/gdp_dept_2010.txt'}, { async: false, autoBind: true, loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); } });// prepare jqxChart settings$scope.chartSettings = {title: "Economic comparison",description: "GDP and Debt in 2010",showLegend: true,enableAnimations: true,padding: { left: 5, top: 5, right: 50, bottom: 5 },titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },source: dataAdapter,xAxis:{dataField: 'Country',showGridLines: true},colorScheme: 'scheme01',seriesGroups:[{type: 'column',columnsGapPercent: 50,valueAxis:{unitInterval: 5000,displayValueAxis: true,description: 'GDP & Debt per Capita($)'},series: [{ dataField: 'GDP', displayText: 'GDP per Capita' },{ dataField: 'Debt', displayText: 'Debt per Capita' }]},{type: 'line',valueAxis:{unitInterval: 10,displayValueAxis: false,description: 'Debt (% of GDP)'},series: [{ dataField: 'DebtPercent', displayText: 'Debt (% of GDP)' }]}]};$scope.setLineChartType = function () {$scope.chartSettings.seriesGroups[0].type = 'line';}});</script></head><body><div ng-controller="demoController"><jqx-chart jqx-settings="chartSettings" jqx-watch="chartSettings.seriesGroups" style="width: 850px; height: 500px;"></jqx-chart><br /><jqx-button jqx-on-click="setLineChartType()">Set Line Chart Type</jqx-button></div></body></html>
<!DOCTYPE><html ng-app="demoApp"><head><title>Binding to JSON</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script><script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope, $http) {$scope.createWidget = false;$http({method: 'get',url: '../../sampledata/beverages.txt'}).success(function (data, status) {// prepare the datavar source ={datatype: "json",datafields: [{ name: 'name', type: 'string' },{ name: 'type', type: 'string' },{ name: 'calories', type: 'int' },{ name: 'totalfat', type: 'string' },{ name: 'protein', type: 'string' }],id: 'id',localdata: data};var dataAdapter = new $.jqx.dataAdapter(source);$scope.gridSettings ={width: 850,source: dataAdapter,columnsresize: true,columns: [{ text: 'Name', datafield: 'name', width: 250 },{ text: 'Beverage Type', datafield: 'type', width: 250 },{ text: 'Calories', datafield: 'calories', width: 180 },{ text: 'Total Fat', datafield: 'totalfat', width: 120 },{ text: 'Protein', datafield: 'protein', minwidth: 120 }]};$scope.createWidget = true;}).error(function (data, status) {// Some error occurred});});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-create="createWidget" jqx-settings="gridSettings"></jqx-grid></div></body></html>
<!DOCTYPE>By using the "jqx-instance" attribute, you can invoke a method using the syntax in the above example. To call a method, you can also use the object bound to the "jqx-settings" attribute. The widget's directive automatically extends that object by adding a function called apply to that object and you can use it to invoke a method of the widget. You can also use the widget's name instead of apply.<html ng-app="demoApp"><head><title>Grid directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script><script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {// Grid data.$scope.people = [{id: 1,name: "Pedro",age: 13}, {id: 2,name: "Clara",age: 22}, {id: 3,name: "John",age: 33}, {id: 4,name: "Pier",age: 27}];$scope.grid = {};$scope.settings ={altrows: true,width: 500,height: 300,ready: function(){$scope.grid.selectrow(1);},source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }]}});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-instance="grid" jqx-settings="settings"></jqx-grid></div></body></html>
$scope.settings =or{altrows: true,width: 500,height: 300,ready: function(){$scope.settings.apply('selectrow', 1);},source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }]}
$scope.settings =If you need to compile a widget's html tag manually, you can use the $.jqx.angularCompile function and pass a DOM element as function argument.{altrows: true,width: 500,height: 300,ready: function(){$scope.settings.jqxGrid('selectrow', 1);},source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }]}
<!DOCTYPE><html ng-app="demoApp"><head><title>Grid directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script><script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {// Grid data.$scope.people = [{id: 1,name: "Pedro",age: 13}, {id: 2,name: "Clara",age: 22}, {id: 3,name: "John",age: 33}, {id: 4,name: "Pier",age: 27}];$scope.grid = {};$scope.settings ={altrows: true,width: 500,height: 300,ready: function(){$scope.grid.selectrow(1);},source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }]}$scope.bindingComplete = function (event) {alert("binding is completed");}});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-on-bindingcomplete="bindingComplete()" jqx-instance="grid" jqx-settings="settings"></jqx-grid></div></body></html>
<!DOCTYPE><html ng-app="demoApp"><head><title>Grid directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script><script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {// Grid data.$scope.people = [{id: 1,name: "Pedro",age: 13}, {id: 2,name: "Clara",age: 22}, {id: 3,name: "John",age: 33}, {id: 4,name: "Pier",age: 27}];$scope.grid = {};$scope.settings ={altrows: true,width: 500,height: 300,ready: function(){$scope.grid.selectrow(1);},source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }]}$scope.$on('bindingComplete', function (event) {alert("binding is completed");});});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-on-bindingcomplete="bindingComplete" jqx-instance="grid" jqx-settings="settings"></jqx-grid></div></body></html>
<!DOCTYPE>When a widget is created, the plug-in raises an event with the following name: 'widget name' + 'Created', i.e for jqxDropDownList, the event name is 'jqxDropDownListCreated'.<html ng-app="demoApp"><head><title>Grid directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script><script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {// Grid data.$scope.people = [{id: 1,name: "Pedro",age: 13}, {id: 2,name: "Clara",age: 22}, {id: 3,name: "John",age: 33}, {id: 4,name: "Pier",age: 27}];$scope.grid = {};$scope.settings ={altrows: true,width: 500,height: 300,ready: function(){$scope.grid.selectrow(1);},source: $scope.people,columns: [{ text: 'Id', dataField: 'id', width: 150 },{ text: 'Name', dataField: 'name', width: 200 },{ text: 'Age', dataField: 'age', width: 150 }],bindingcomplete: function (event) {alert("binding is completed");}}});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-instance="grid" jqx-settings="settings"></jqx-grid></div></body></html>
<!DOCTYPE>if you work with jqxSettings, you can also define a "created" callback function in the settings object. We call that function when the widget is created and initialized and pass a JSON object as argument. That JSON object is equal to the one passed in the "created" event described above.<html ng-app="demoApp"><head><title>Event Handling using jqxAngular plug-in</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {$scope.people = [{id: 1,name: "Nancy",age: 52}, {id: 2,name: "Andrew",age: 31}, {id: 3,name: "Robert",age: 40}, {id: 4,name: "Peter",age: 28}];// init DropDownList's settings object.$scope.dropDownListSettings ={width: 200,height: 30,autoDropDownHeight: true,displayMember: "name",valueMember: "id",source: $scope.people}$scope.$on('jqxDropDownListCreated', function (event, arguments) {});});</script></head><body><div ng-controller="demoController"><jqx-drop-down-list jqx-settings="dropDownListSettings"></jqx-drop-down-list></div></body></html>
<!DOCTYPE><html ng-app="demoApp"><head><title>Using ngModel with jQWidgets</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxradiobutton.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script><script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {$scope.user = {name: "Brian",working: true,birthDate: new Date(1980, 3, 2),friends: ["Peter","Nancy","Michael","John","Robert"],bestFriend: "Peter",married: true,color: "Blue",car: true,children: 'YES'};});</script></head><body><div ng-controller="demoController"><form name="userForm"><jqx-input jqx-width="200" jqx-height="25" name="userName" ng-model="user.name"></jqx-input><br /><br /><jqx-date-time-input jqx-width="200" jqx-height="25" ng-model="user.birthDate"></jqx-date-time-input><br /><jqx-drop-down-list jqx-auto-drop-down-height="true" jqx-width="200" jqx-height="25" jqx-source="user.friends" ng-model="user.bestFriend"></jqx-drop-down-list><br /><jqx-check-box ng-model="user.working">Working</jqx-check-box><br /><jqx-radio-button jqx-group-name="'married'" value="true" ng-model="user.married">Married</jqx-radio-button><br /><jqx-radio-button jqx-group-name="'married'" value="false" ng-model="user.married">Not Married</jqx-radio-button><br />Favorite Color:<br /><br /><jqx-radio-button jqx-group-name="'colors'" value="'Green'" ng-model="user.color">Green</jqx-radio-button><br /><jqx-radio-button jqx-group-name="'colors'" value="'Blue'" ng-model="user.color">Blue</jqx-radio-button><br /><jqx-check-box ng-model="user.car">Car</jqx-check-box><br /><jqx-check-box ng-true-value="'YES'" ng-false-value="'NO'" ng-model="user.children">Children</jqx-check-box></form><pre>user.name = <span ng-bind="user.name"></span></pre><pre>user.working = <span ng-bind="user.working"></span></pre><pre>user.birthDate = <span ng-bind="user.birthDate"></span></pre><pre>user.bestFriend = <span ng-bind="user.bestFriend"></span></pre><pre>user.married = <span ng-bind="user.married"></span></pre><pre>user.color = <span ng-bind="user.color"></span></pre><pre>user.car = <span ng-bind="user.car"></span></pre><pre>user.children = <span ng-bind="user.children"></span></pre></div></body></html>
<!DOCTYPE html>With the jqxAngular plugin's "jqwidgets-amd" module, you may only load jqxcore.js and jqxangular.js files and the rest of the files will be loaded by the plugin.<html ng-app="demoApp"><head><title id="Description">jqxGrid directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script><script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script><script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script><script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script><script type="text/javascript" src="../../jqwidgets/jqxgrid.sort.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets"]);demoApp.controller("demoController", function ($scope) {// Grid data.var data = new Array();var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"];var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"];var titles = ["Sales Representative", "Vice President, Sales", "Sales Representative", "Sales Representative", "Sales Manager", "Sales Representative", "Sales Representative", "Inside Sales Coordinator", "Sales Representative"];var address = ["507 - 20th Ave. E. Apt. 2A", "908 W. Capital Way", "722 Moss Bay Blvd.", "4110 Old Redmond Rd.", "14 Garrett Hill", "Coventry House", "Miner Rd.", "Edgeham Hollow", "Winchester Way", "4726 - 11th Ave. N.E.", "7 Houndstooth Rd."];var city = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "London", "London", "Seattle", "London"];var country = ["USA", "USA", "USA", "USA", "UK", "UK", "UK", "USA", "UK"];for (var i = 0; i < firstNames.length; i++) {var row = {};row["firstname"] = firstNames[i];row["lastname"] = lastNames[i];row["title"] = titles[i];row["address"] = address[i];row["city"] = city[i];row["country"] = country[i];data[i] = row;}$scope.people = data;$scope.columns =[{ text: 'Name', datafield: 'firstname', width: 120 },{ text: 'Last Name', datafield: 'lastname', width: 120 },{ text: 'Title', datafield: 'title', width: 180 },{ text: 'Address', datafield: 'address', width: 180},{ text: 'City', datafield: 'city', width: 90 },{ text: 'Country', datafield: 'country' }];});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-columns="columns" jqx-sortable="true" jqx-source="people" jqx-width="800" jqx-height="200" jqx-alt-rows="true"></jqx-grid></div></body></html>
<!DOCTYPE html>When the scripts of a particular widget are loaded, the plug-in raises an event with the following name: 'widget name' + 'ScriptsLoaded', i.e for jqxGrid, the event name is 'jqxGridScriptsLoaded'. When we raise that event, we pass a JSON object with the following members:<html ng-app="demoApp"><head><title id="Description">jqxGrid directive for AngularJS</title><link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css" /><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets", "jqwidgets-amd"]);demoApp.controller("demoController", function ($scope) {// Grid data.var data = new Array();var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"];var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"];var titles = ["Sales Representative", "Vice President, Sales", "Sales Representative", "Sales Representative", "Sales Manager", "Sales Representative", "Sales Representative", "Inside Sales Coordinator", "Sales Representative"];var address = ["507 - 20th Ave. E. Apt. 2A", "908 W. Capital Way", "722 Moss Bay Blvd.", "4110 Old Redmond Rd.", "14 Garrett Hill", "Coventry House", "Miner Rd.", "Edgeham Hollow", "Winchester Way", "4726 - 11th Ave. N.E.", "7 Houndstooth Rd."];var city = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "London", "London", "Seattle", "London"];var country = ["USA", "USA", "USA", "USA", "UK", "UK", "UK", "USA", "UK"];for (var i = 0; i < firstNames.length; i++) {var row = {};row["firstname"] = firstNames[i];row["lastname"] = lastNames[i];row["title"] = titles[i];row["address"] = address[i];row["city"] = city[i];row["country"] = country[i];data[i] = row;}$scope.people = data;$scope.columns =[{ text: 'Name', datafield: 'firstname', width: 120 },{ text: 'Last Name', datafield: 'lastname', width: 120 },{ text: 'Title', datafield: 'title', width: 180 },{ text: 'Address', datafield: 'address', width: 180},{ text: 'City', datafield: 'city', width: 90 },{ text: 'Country', datafield: 'country' }];});</script></head><body><div ng-controller="demoController"><jqx-grid jqx-columns="columns" jqx-sortable="true" jqx-source="people" jqx-width="800" jqx-height="200" jqx-alt-rows="true"></jqx-grid></div></body></html>
<!DOCTYPE html><html ng-app="demoApp" lang="en"><head><title id='Description'>This example illustrates how to asynchronously load the required files.</title><link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /><script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script><script type="text/javascript" src="../../scripts/angular.min.js"></script><script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script><script type="text/javascript" src="../../jqwidgets/jqxangular.js"></script><script type="text/javascript" src="../../scripts/demos.js"></script><script type="text/javascript" src="../../sampledata/generatedata.js"></script><script type="text/javascript">var demoApp = angular.module("demoApp", ["jqwidgets", "jqwidgets-amd"]);demoApp.controller("demoController", function ($scope, $http) {var data = generatedata(500);var source ={localdata: data,datafields:[{ name: 'name', type: 'string' },{ name: 'productname', type: 'string' },{ name: 'available', type: 'bool' },{ name: 'date', type: 'date'},{ name: 'quantity', type: 'number' }],datatype: "array"};$scope.gridSettings ={width: 850,showfilterrow: true,filterable: true,selectionmode: 'multiplecellsextended',columns: [{ text: 'Name', columntype: 'textbox', filtertype: 'input', datafield: 'name', width: 215 },{text: 'Product', filtertype: 'checkedlist', datafield: 'productname', width: 220},{ text: 'Available', datafield: 'available', columntype: 'checkbox', filtertype: 'bool', width: 67 },{ text: 'Ship Date', datafield: 'date', filtertype: 'range', width: 210, cellsalign: 'right', cellsformat: 'd' },{ text: 'Qty.', datafield: 'quantity', filtertype: 'number', cellsalign: 'right' }]};$scope.$on('jqxGridScriptsLoaded', function () {var dataAdapter = new $.jqx.dataAdapter(source);$scope.gridSettings.source = dataAdapter;});});</script></head><body ng-controller="demoController"><jqx-grid jqx-settings="gridSettings"></jqx-grid></body></html>