easy ui下拉框combobox如何填充数据

<th
data-options="field:'type',width:90,sortable:true,formatter:typesFormatter,
editor:{
type:'combobox',
options:{
valueField:'id',
textField:'name',
data:types,
editable:false,
required:true
}

}">类型</th>


"field:'type'是和数据库表中的匹配的字段名称一致


valueField:'id',   

textField:'name',

data:types,       data是用什么数组填充

required:true   是否必填

跟我们定义的type数组是键值对的, valueField是实际存入数据库的值,textField是我们显示的值


③根据自己的需要填写,如果需要格式化则需要填写,如不希望显示的是数据库的英文字段,而是我们显示中文意识,则需要格式化

猜你喜欢

转载自blog.csdn.net/qq_37725560/article/details/80388186
今日推荐