1:开发文档地址:http://106.14.124.170/doc/#/
2:下拉框初始化赋值
$("#id").ysComboBox({
url: "url",
key: "Id",
value: "CourseName",
class: "form-control"
})
$("#id").ysComboBox({
data: top.getDataDict("DictType"),
key: "DictKey",
value: "DictValue",
class: "form-control"
})
2:联动时下拉框变短问题,没有深入过js底层,目前用样式方法解决;
<style>
#id span {
width: 100% !important;
}
#id .select2-container--default .select2-selection--single .select2-selection__arrow b {
left: 96%;
}
</style>
3:下拉框取值赋值方法
$('#id').ysComboBox('setValue', value)
$('#id').ysComboBox('getValue')
4:top对象获取字典值方法:
top.getDataDict("DictType");
top.getDataDictValue('DictType', value);
//index页中
{
field: 'field', title: 'title公共', formatter: function (value, row, index) {
return top.getDataDictValue('DictType', value);
}
{
title: 'title',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-info btn-xs" onclick="Add(\'' + row.Id + '\',\'' + row.Name + '\')">Title</a> ');
return actions.join('');
}
},