1

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

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;
}
});
4

1 回答 1

0

这个问题已经解决了。

    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;
    }
    });
于 2014-03-07T08:00:15.177 回答