剑道网格滤波器与“;包含“;但不是平等
kendo grid filter works with "contains" but not equality
我无法获得相等筛选器("等于"或"不等于")来处理剑道网格中的"请求状态"列。我可以在网格中的其他列上使用它,例如Buyer。
但是"包含"过滤器适用于"请求状态"列。为什么不等于工作?
示例:正确包含"已拒绝"筛选器。等于"拒绝"则不然。
HTML:
<div class="k-content">
<table id="grid" style="display:none;">
<colgroup>
<col />
<col />
<col />
<col />
<col />
<col />
<col />
<col />
<col />
</colgroup>
<thead style="font-size:80%;">
<tr>
<th>Id</th>
<th>Request Status</th>
<th>Vendor Rep</th>
<th>Buyer</th>
<th>UPC</th>
<th>Brand</th>
<th>Description</th>
<th>Create Date</th>
<th>Update Date</th>
</tr>
</thead>
<tbody>
@foreach (var itemRequest in this.Model)
{
<tr>
<td>@itemRequest.Id</td>
<td>@(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.Draft ? "Draft" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.MerchandisingReview ? "Merchandising" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.SpacePlanningReview ? "Space Planning" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.DataIntegrityReview ||
itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.DataIntegrityFinalReview ? "Data Integrity" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.VendorRepReview ? "Vendor Rep" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.Approved ? "Approved" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.Rejected ? "Rejected" : ""
)))))))
</td>
<td>@itemRequest.GetAuthor().FirstName @itemRequest.GetAuthor().LastName</td>
<td>@(itemRequest.GetBuyer() != null ? @String.Format("{0}", itemRequest.GetBuyer().Name) : "")</td>
<td>@itemRequest.Upc</td>
<td>@itemRequest.BrandCode</td>
<td>@itemRequest.Description</td>
<td>@itemRequest.CreateDate.ToShortDateString()</td>
<td>@(itemRequest.LastUpdateDate.HasValue ? ((DateTime)itemRequest.LastUpdateDate).ToShortDateString() : "")</td>
</tr>
}
</tbody>
</table>
</div>
脚本:
<script src="~/Content/Scripts/kendo/js/kendo.web.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#grid").kendoGrid({
sortable: true,
scrollable: false,
filterable: true,
pageable: true,
dataSource: {
schema: {
model: {
id: "Id",
fields: {
Id: { type: "number" },
//2014-03-27: Issue #69
ItemRequestStatusId: { type: "string" },
VendorRep: { type: "string" },
Buyer: { type: "string" },
Upc: { type: "number" },
Brand: { type: "string" },
Description: { type: "string" },
CreateDate: { type: "date" },
UpdateDate: { type: "date" }
}
}
},
pageSize: 10
},
columns: [
{ field: "Id", template: "<a href='"/items/itemrequest/display/#: Id #'">#: Id # </a>" },
{ field: "ItemRequestStatusId" },
{ field: "VendorRep" },
{ field: "Buyer" },
{ field: "Upc" },
{ field: "Brand" },
{ field: "Description" },
{ field: "CreateDate", format: "{0:MM/dd/yyyy}" },
{ field: "UpdateDate", format: "{0:MM/dd/yyyy}" }
]
});
$("#grid").css("display", "table");
var grid = $("#grid").data("kendoGrid");
var hide = $('#hide_Status').val()
if(hide)
{
grid.hideColumn(1);
}
var tacos = 0;
});
</script>
无论出于何种原因,都可以将ItemRequestStatusId分配给变量,然后在单元格中使用该变量。
更改为HTML:
@foreach (var itemRequest in this.Model)
{
string status = (itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.Draft ? "Draft" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.MerchandisingReview ? "Merchandising" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.SpacePlanningReview ? "Space Planning" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.DataIntegrityReview ||
itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.DataIntegrityFinalReview ? "Data Integrity" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.VendorRepReview ? "Vendor Rep" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.Approved ? "Approved" :
(itemRequest.ItemRequestStatusId == Portal.BusinessModel.Entities.ItemRequestStatusId.Rejected ? "Rejected" : ""
)))))));
<tr>
<td>@itemRequest.Id</td>
<td>@status</td>
<td>@itemRequest.GetAuthor().FirstName @itemRequest.GetAuthor().LastName</td>
<td>@(itemRequest.GetBuyer() != null ? @String.Format("{0}", itemRequest.GetBuyer().Name) : "")</td>
<td>@itemRequest.Upc</td>
<td>@itemRequest.BrandCode</td>
<td>@itemRequest.Description</td>
<td>@itemRequest.CreateDate.ToShortDateString()</td>
<td>@(itemRequest.LastUpdateDate.HasValue ? ((DateTime)itemRequest.LastUpdateDate).ToShortDateString() : "")</td>
</tr>
}
相关文章:
- 当包含另一个asp文件时,是否也包含所有引用的样式和脚本页面
- 货币代码为欧元-金额的格式不应包含小数
- 如何包含特定于每个视图angularjs的javascript文件
- 我如何修复包含在captcha的addthis中的错误
- 正在注入包含JS的HTML
- Json数据包含日期和时间格式
- Angular js-返回一个包含类似
- jQuery/JS包含运算符或类似运算符
- 如果href包含X,请更改href
- JavaScript数组包含一个值
- 带有填充属性的SVG矩形显示在包含元素的上方插入框阴影
- 在Meteor项目中安装并包含npm模块后出错
- 传递包含'%的参数'在URL中
- 对一个对象使用reduce可以返回一个没有't在数组中包含目标字母
- 如何首先设置样式<td>表中包含在窗体中的元素
- 每天用javascript包含不同的php文件
- 数据绑定:'系统Char'不包含名为'xxxxx'
- 使用Javascript生成包含JSP的HTML
- 角滤波器包含
- 剑道网格滤波器与“;包含“;但不是平等