首页 > 解决方案 > 在 SAPUI5 中,您可以通过单击按钮触发 Smart Table 事件吗?

问题描述

我想使用智能表的内置编辑功能,但我想从我放置在溢出工具栏中的按钮触发它。

这是我要触发的事件,https://sapui5.hana.ondemand.com/#/api/sap.ui.comp.smarttable.SmartTable/events/editToggled

像这样的东西:

onEditPromotionsPressed: function(){
    this.editToggled();
},

editToggled在我的控制器中未被识别为功能。我需要将智能表控件添加到控制器中吗?

标签: javascriptsapui5

解决方案


您可以使用下面的此功能从不同的按钮按下调用智能表切换

火编辑切换

例子:

 //Other button to call edit function
    onEditPromotionsPressed: function(){
        this.fireEditToggled();
    },

    on smarttable controller you need to specify function for editToggled event and this will be called through fireEditToggled() 

推荐阅读