大家晚上好,
我使用 jqgrid 和 jsonstring 数据类型,并使用搜索框进行搜索。
这会导致(听起来很正常)一个将列名作为过滤器的搜索框。
例如
colNames:['名称','开始日期','结束日期']
将导致搜索框中出现一个包含三个选项值的下拉菜单:
名称、开始日期和结束日期
有没有办法将名称、开始日期和结束日期保留为我的网格标题,但在搜索框的过滤器下拉列表中具有不同的选项值?
预先感谢您的帮助
最佳答案
您可以使用label
属性来定义将在搜索对话框中显示的列文本。例如the demo使用以下属性
colNames: ["Client", "Date", "Amount", "Tax", "Total",
"Closed", "Shipped via", "Notes"],
colModel: [
{ name: "name", ..., label: "Client Name" },
{ name: "invdate", ..., label: "Start Date" },
{ name: "amount", ..., label: "Amount without TAX" },
{ name: "tax", ... },
{ name: "total", ..., label: "Total Price" },
{name: "closed", ..., label: "Is Closed?" },
{name: "ship_via", ... },
{ name: "note", ... }
],
关于javascript - jqgrid搜索框下拉过滤器名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27875518/