gpt4 book ai didi

javascript - Backgrid 表标题上的工具提示

转载 作者:行者123 更新时间:2023-11-28 07:19:27 24 4
gpt4 key购买 nike

我正在使用 backgrid 来显示表格。我想在表格标题上显示工具提示。

有人可以帮忙吗?

最佳答案

扩展 Backgrid.HeaderRow

  Backgrid.HeaderRow = Backgrid.HeaderRow.extend({
render: function() {
var that = this;
Backgrid.HeaderRow.__super__.render.apply(this, arguments);
_.each(this.columns.models, function(modelValue) {
if (modelValue.get('toolTip')) that.$el.find('.' + modelValue.get('name')).attr('title', modelValue.get('toolTip'))
});
return this;
}
});

并在列中传递工具提示

var pageableGrid = new Backgrid.Grid({
columns: [{
// enable the select-all extension
name: "",
cell: "select-row",
headerCell: "select-all",
toolTip:"test tool tip"
}].concat(columns),
collection: pageableTerritories
});

关于javascript - Backgrid 表标题上的工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30474353/

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