RouterLink无法在角度2的网格中工作

时间:2017-04-21 06:01:24

标签: angular datagridview angular2-routing

最近我开始在我的Angular项目中使用jqwidgets (here), 它工作得很好,但唯一的问题是我在每个单元格中编辑。要编辑按钮routerLink不起作用。

我的代码,

this.columns =
[
    {
        text: 'Id', columntype: 'textbox', width: 80
    },
    {
        text: 'Name', columntype: 'textbox',datafield: 'name', width: 130
    },
    {
        text: 'Group Name', columntype: 'textbox', datafield: 'group_id', width: 130
    },
    {
        text: 'Actions',datafield: 'id', cellsrenderer: Action, width: 100
    }
];

这是我的行动功能,

 var Action = function (row,datafield,value) {    
    return '<button ><a routerLink="pages/users">EDIT</a</button>'
 }

当我用href替换routerLink工作时,任何人都可以帮助我。谢谢。

1 个答案:

答案 0 :(得分:1)

似乎这个小部件会将你的html代码直接添加到DOM。因此角度被绕过并且它不是“有效的”角度对象,并且不被角度本身处理/识别。

这个小部件的问题,似乎你无法改变这种行为。

相关问题