我需要隐藏列的列索引,当它显示时,我在 columnShowing 事件中处理它,根据文档,我们可以通过使用 ui.columnIndex 来获取它。但它在 ui.columnKey 给出适当值的地方是未定义的。
这是代码
{
name: "Hiding",
columnChooserHeight: 400,
columnChooserWidth: 400,
columnShowing: function (evt, ui) {
alert(ui.columnIndex);
}
}
这是显示问题的小提琴。
当您单击查看第一个隐藏列时 ui.columnIndex 未定义且 ui.columnKey 具有值。