有没有办法更改 sapui 中的排序器图标?
Is there a way to change the sorter icon in sapui?
我正在使用 sapui5 创建一个 table。我想知道我是否可以将升序排序和降序排序的默认图标更改为我自己的图标?
附加问题:
有没有一种方法可以在 header 中显示我的自定义图标而无需先点击它?
只需在 Web 开发人员工具中检查 table,然后将鼠标悬停在页面中的图标上。
你应该找到这样的东西:
有了这个,您就可以使用 link 并在您的系统中跟随它并替换它。如果我找到一个更快的方法来通过编码替换它,我会编辑这个post。
附加问题:是的,这是可能的,但前提是您选择从一开始就过滤该列,例如:
var oColumn = new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Last Name"}),
template: new sap.ui.commons.TextView().bindProperty("text", "lastName"),
sortProperty: "lastName",
filterProperty: "lastName",
width: "200px"
});
//Initially sort the table
oTable.sort(oTable.getColumns()[0]);
定义如何对列进行排序,并使用 oTable.getColumns()[0]
定义列的编号,0 是第一行(在 JavaScript 数组中以 0 开头)。
我正在使用 sapui5 创建一个 table。我想知道我是否可以将升序排序和降序排序的默认图标更改为我自己的图标?
附加问题: 有没有一种方法可以在 header 中显示我的自定义图标而无需先点击它?
只需在 Web 开发人员工具中检查 table,然后将鼠标悬停在页面中的图标上。 你应该找到这样的东西:
有了这个,您就可以使用 link 并在您的系统中跟随它并替换它。如果我找到一个更快的方法来通过编码替换它,我会编辑这个post。
附加问题:是的,这是可能的,但前提是您选择从一开始就过滤该列,例如:
var oColumn = new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Last Name"}),
template: new sap.ui.commons.TextView().bindProperty("text", "lastName"),
sortProperty: "lastName",
filterProperty: "lastName",
width: "200px"
});
//Initially sort the table
oTable.sort(oTable.getColumns()[0]);
定义如何对列进行排序,并使用 oTable.getColumns()[0]
定义列的编号,0 是第一行(在 JavaScript 数组中以 0 开头)。