gpt4 book ai didi

jquery - 自定义行颜色 Jquery Bootgrid

转载 作者:行者123 更新时间:2023-12-01 07:07:15 30 4
gpt4 key购买 nike

使用 jQuery Bootgrid,“默认”状态映射可以工作(成功、信息、警告、错误),但当我自定义它时,它就不起作用了。这个问题的解决方案在我的情况下不起作用:Jquery Bootgrid table row color based on condition

下面是我对脚本的初始化。

$(document).ready(function(){
$("#client_list").bootgrid({
css: {
icon: "zmdi icon",
iconColumns: "zmdi-view-module",
iconDown: "zmdi-sort-amount-desc",
iconRefresh: "zmdi-refresh",
iconUp: "zmdi-sort-amount-asc"
},
ajax: true,
post: function(){
return { id: "b0df282a-c9e93b7befee" };
},
url: "get_logview/client/client",
caseSensitive: false,
selection: false,
multiSelect: true,
rowSelect: true,
searchSettings: {
delay: 100,
characters: 3
},
keepSelection: true,
statusMappings: {
4: "loglow",
5: "logmediumlow",
6: "logmedium",
7: "logmediumhigh",
8: "loghigh",
9: "logcritical",
10: "logcatastrophic"
}
});
});

我的数据确实包含正确的状态值,如下所示:

{
"current": 1,
"rowCount": "10",
"rows": [
{
"id": "1",
"type": "Notice",
"message": "User 127.0.0.1 (User ID: 1) accessed the logs.",
"impact": "Low",
"user": "127.0.0.1 (User ID: 1)",
"createdate": "2016-07-20 19:39:03",
"status": 4
},
{
"id": "2",
"type": "Notice",
"message": "User 127.0.0.1 (User ID: 1) accessed the logs.",
"impact": "Low",
"user": "127.0.0.1 (User ID: 1)",
"createdate": "2016-07-20 19:39:03",
"status": 4
}
],
"total": "2"
}

有人可以告诉我我做错了什么吗?没有控制台错误,并且会显示 bootgrid 表,但不会执行自定义颜色。

最佳答案

发现问题:初始化必须是“statusMapping”,而不是“statusMappings”。该插件的文档不正确:http://www.jquery-bootgrid.com/documentation#statusmappings

将相应地在 Github 上提交错误报告。

关于jquery - 自定义行颜色 Jquery Bootgrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38487566/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com