我希望按预期的方式在标题行单元格下创建和显示输入过滤器字段。
在我的MVC解决方案中,我的JSGrid通过AJAX/JSON/GET进行填充。当我添加"filtering:true“时,我能够对loadData、javascript等进行排序,在标题行和表主体行之间生成带有单元格的行,但是输入字段不存在。我尝试过包括不同的CSS、JQuery和JS库,并试图模仿许多演示程序和示例。
function RenderImportHistory() {
$("#jsGrid_ImportHistory").jsGrid({
width: "100%",
height: "572px",
pageSize: 10,
pageButtonCount: 5,
filtering: true,
editing: true,
sorting: true,
paging: true,
autoload: true,
loadIndication: true,
loadIndicationDelay: 500,
loadMessage: "Getting Import History ...",
controller: {
loadData: function (filter) {
var d = $.Deferred();
$.ajax({
url: "@Url.Action("GetImportHistory", "SCAL", new { Area = "Admin" })",
dataType: "json",
type: "GET"
}).done(function(result) {
/*result = $.grep(result, function(item) {
return item.patientId === filter.patientId
&& item.patientName === filter.patientName
&& item.genderId === filter.genderId
&& item.mobile === filter.mobile;
}); */
d.resolve(result);
});
return d.promise();
}
},
fields: [
{ name: "ID", type: "Number", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 11, sorter:"number" },
{ name: "ImportSched_ID", type: "Number", title: "Schedule", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 27, sorter:"number" },
{ name: "Created", type: "Text", title: "Started", css: "jsGrid_Body", headercss: "jsGrid_Head", itemTemplate: function (value) { return FormatDateTime(value); } },
{ name: "Completed", type: "Text", title: "Ended", css: "jsGrid_Body", headercss: "jsGrid_Head", itemTemplate: function (value) { return FormatDateTime(value); } },
{ name: "NumOfClaims", type: "Number", title: "Claims", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatCounts(value); } },
{ name: "NumOfRecords", type: "Number", title: "Rows", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatCounts(value); } },
{ name: "TimeToRead_Seconds", type: "Number", title: "Read", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatDuration(value); } },
{ name: "TimeToWrite_Seconds", type: "Number", title: "Wrote", css: "jsGrid_Body", headercss: "jsGrid_Head", width: 21, sorter: "number", itemTemplate: function (value) { return FormatDuration(value); } }
]
});
}发布于 2019-05-17 21:26:15
好吧,其实很简单,也很傻。它是如此的愚蠢和简单,以至于很容易被忽略。将字段中的类型声明更改为所有小写。
类型:“数字”>>类型:“数字”
和
类型:"Text“>>类型:"text”
开发人员应该对大小写不敏感,但懒散的开发人员.
发布于 2020-07-28 13:42:45
也许这个话题已经开放了很长时间。但是我遇到了同样的问题,并且使用了标题:真正的属性为我工作。
https://stackoverflow.com/questions/56192931
复制相似问题