jQuery MiniUI
标题:
动态生成grid列时如何添加过滤框
[打印本页]
作者:
simple0145
时间:
2019-3-21 14:34:27
标题:
动态生成grid列时如何添加过滤框
通过这种方式添加的列,
grid.set({
columns : columns
});
怎么添加过滤框? 只是设置
showFilterRow
="
true
" 出来的是空白
<div field="name" width="120" headerAlign="center" allowSort="true">姓名
<input id="nameFilter" property="filter" class="mini-textbox" style="width:100%;" />
</div>
作者:
felt
时间:
2019-3-21 14:57:12
columns: [
{ type: "checkColumn" },
{ field: "loginname", header: "员工帐号", allowSort: true, headerAlign: "center", width: 120, editor: { type: "textbox", cls: "aa" }, filter: { type: "textbox", width: "100%", onValueChanged: onValueChanged }
},
{ field: "name", header: "姓名", headerAlign: "center", width: 120, filter: { type: "filteredit", width: "100%", filterData: ageFilters} },
{ header: "工作信息", headerAlign: "center", columns: [
{ headerStyle: "color:blue", field: "dept_name", header: "所属部门", width: 120 },
{ field: "position_name", header: "职位", width: 100 },
{ field: "salary", header: "薪资", dataType: "currency", currencyUnit: "¥", align: "right", width: 100, allowSort: true }
]
},
{ field: "createTime", header: "创建时间", headerAlign: "center", width: 100, dateFormat: "yyyy-MM-dd" },
{ header: "基本信息", columns: [
{ header: "信息", columns: [
{ field: "gender", header: "性别", width: 100, renderer: onGenderRenderer },
{ field: "age", header: "年龄", width: 100, allowSort: true },
{ field: "conutry", type:"comboboxColumn",header: "国家", width: 100, allowSort: true, editor: {type:"combobox",url:"../data/countrys.txt"} },
{ field: "birthday", header: "出生日期", width: 100, renderer: onBirthdayRenderer }
]
},
{ field: "married", header: "婚否", width: 100, align: "center", renderer: onMarriedRenderer },
{ field: "email", header: "邮箱", width: 100 }
]
},
{ header: "学历信息", columns: [
{ field: "educational_name", header: "学历", width: 100 },
{ field: "school", header: "毕业院校", width: 120 }
]
}
]
复制代码
需要在columns数据内包含filter
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2