一些小总结-04

7.easyUI中的datagrid控制列表特殊行颜色
如图:


在datagrid的样式里面做一个判断,当某中条件的时候就进行行内样式的修改,其他的都不变。
<div data-options="region:'center'">
    <table id="projectList" class="easyui-datagrid" data-options="
            rowStyler: function(index,row){
               if (row.status ==0){
                  return 'color:gray';
               }
            }"
width="100%">
        <div id="tb" class="list_opear">
            <a onclick="toEdit('')" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新建</a>
        </div>
    </table>
</div>
8.easyUI中的combobox下拉框前台本地搜索
如图:


HTML:
<td align="center"><span style="color: red">*</span>负责人</td>
<td><input id="ownerid" class="easyui-combobox" data-options="required:true"
          
style="width:200px;"/></td>
JavaScript:
function loadlb() {
    var json = getJsonData('../getUserList.hebe');//初始数据后台获取
    $("#ownerid").combobox({
        prompt: '输入姓氏后自动搜索',//该属性是textbox中的
        mode: "local",//定义文本改变时过滤读取本地列表
        data: json,//数据格式
        valueField: 'id',//组件值
        textField: 'name',//文本值
        hasDownArrow: true,//定义显示向下箭头按钮
        filter: function (q, row) {//文本参数显示列表
            var opts = $(this).combobox('options');
            return row[opts.textField].indexOf(q) == 0;
        }
    });
}
则可以实现前台本地搜索定位,如图:


原文地址:https://www.cnblogs.com/bad-guy/p/10997663.html