jqxGrid/jqxDropDownList Demo
Demonstrate issue with jqxDropDownList not always setting label field correctly.
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.6.0/lodash.min.js"></script>
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='playersDiv'></div>
JavaScript
$(function () {
'use strict';
var createGrid = function () {
var players = [{
sh_pos: 1,
sh_ln: 'Curry',
sh_fn: 'Tim',
sh_st: 'GA'
}, {
sh_pos: 2,
sh_ln: 'Brooks',
sh_fn: 'Mel',
sh_st: 'FL'
}, {
sh_pos: 3,
sh_ln: 'Akroyd',
sh_fn: 'Dan',
sh_st: 'AL'
}, {
sh_pos: 4,
sh_ln: 'Murphy',
sh_fn: 'Eddie',
sh_st: 'GA'
}, {
sh_pos: 5,
sh_ln: 'Belushi',
sh_fn: 'John',
sh_st: 'AK'
}];
var states = [{
value: '',
label: ''
}, {
value: 'AK',
label: 'Alaska'
}, {
value: 'AL',
label: 'Alabama'
}, {
value: 'AR',
label: 'Arkansas'
}, {
value: 'AZ',
label: 'Arizona'
}, {
value: 'CA',
label: 'California'
}, {
value: 'CO',
label: 'Colorado'
}, {
value: 'CT',
label: 'Connecticut'
}, {
value: 'DE',
label: 'Delaware'
}, {
value: 'FL',
label: 'Florida'
}, {
value: 'GA',
label: 'Georgia'
}];
var statesSource = {
datatype: "array",
datafields: [{
name: 'label',
type: 'string'
}, {
name: 'value',
type: 'string'
}],
localdata: states
};
var statesAdapter = new $.jqx.dataAdapter(statesSource, {
autoBind: true
});
var source = {
datatype: 'json',
datafields: [{
name: 'sh_pos',
type: 'number'
}, {
...