<td style="width:8%;text-align: right;"><label for="province">区县:</label></td>
<td style="width: 17%"><input class="easyui-combobox" type="text" id="qx" name="qx"></input></td>
<td style="width:8%;text-align: right;"><label for="province">因子:</label></td>
<td style="width: 17%"><input id="yz" name="yz" class="easyui-combobox"></td>
$(document).ready(function () {
var yz_ = [{ id: 'pm25', text: "PM2.5", "selected": true }, { id: 'pm10', text: "PM10" }, { id: 'o3', text: "O3" },
{ id: 'so2', text: "SO2" }, { id: 'no2', text: "NO2" }, { id: 'co', text: "CO" }
];
combobox_checkbox('yz', yz_, 'auto');
initSelect();
search();
});
function initSelect() {
$("#startTime").datebox('setValue', setDate(new Date(), true));
$("#endTime").datebox('setValue', setDate(new Date(), false));
}
function combobox_checkbox(_id, optionsJson, hight) {
$('#' + _id).combobox({
data: optionsJson,
valueField: 'id',
textField: 'text',
multiple: false,
formatter: function (row) {
var opts = $(this).combobox('options');
return '<input type="checkbox" class="combobox-checkbox">' + row[opts.textField]
},
onSelect: function (row) {
var opts = $(this).combobox('options');
var el = opts.finder.getEl(this, row[opts.valueField]);
el.find('input.combobox-checkbox')._propAttr('checked', true);
},
onUnselect: function (row) {
var opts = $(this).combobox('options');
$("#point").val($(this).combobox('getValues'));
var el = opts.finder.getEl(this, row[opts.valueField]);
el.find('input.combobox-checkbox')._propAttr('checked', false);
}
})
};