gpt4 book ai didi

javascript - 如何在单个网格中使用 Backgrid.js 制作可编辑和不可编辑的行

转载 作者:行者123 更新时间:2023-11-28 08:32:04 24 4
gpt4 key购买 nike

我想根据条件渲染一个具有可编辑和不可编辑行的网格。我可以通过设置颜色来区分这一点,但使其对于已删除的记录不可编辑会更有用。期待好的解决方案。

var DeletedRow = Backgrid.Row.extend({
render: function () {
DeletedRow.__super__.render.apply(this, arguments);
if (!_.isUndefined(this.model.get("action")) && this.model.get("action") == "D") {
this.el.bgColor = "#C0C0C0";
}
return this;
}
});

最佳答案

此问题已解决。

    var DeletedRow = Backgrid.Row.extend({
render: function () {
DeletedRow.__super__.render.apply(this, arguments);
if (!_.isUndefined(this.model.get("action")) && this.model.get("action") == "D") {
(this.$el.find("td[class=actionDescription]")).parent().find("*").unbind();
this.$el.click(false);
}
return this;
}
});

关于javascript - 如何在单个网格中使用 Backgrid.js 制作可编辑和不可编辑的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21729634/

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