extjs actioncolumn renderer prevents handler

瘦欲@ 提交于 2019-12-11 11:36:26

问题


I have a actioncolumn on my grid with this code:

    this.columns =
    [
        {
            xtype: 'actioncolumn',
            items: [{
                icon: '../Content/Images/Approve.png',
                handler: function (grid, rowIndex, colIndex, node, e, record, rowNode) {
                    alert('test approve')
                }
            }
          ...rest of the columns

when I click the icon, I get the "test approve" message, so it works as expected!

If I add the render method bellow to disable the action column for rows that are already approved:

            renderer: function (value, metadata, record) {
                if (record.get('Approved') = 1) {                        
                    this.items[0].disabled = true
                } else {
                    this.items[0].disabled = false;                       
                }
            }

the handler stops working on the enabled itens. It seems like the renderer function is preventing the handler to be called. I even tried to add the handler code inside the renderer, but also no success.

Any idea why this would happen?


回答1:


your condition statement in the if statement, i assume you meant to compare not assign. thats probably where your code is breaking



来源:https://stackoverflow.com/questions/12674350/extjs-actioncolumn-renderer-prevents-handler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!