最近私の角プロジェクトではjqwidgets
すなわちグリッドを使用しました。ここでは、クリックした各セルに編集を入れて、編集画面にリダイレクトする必要があります。角2のクリック機能でjqueryを使用する方法
私は、次の方法で試してみました:
ケース1:
var Action = function (row, columnfield, value, defaulthtml, columnproperties) {
return '<button onClick="open()">EDIT</button>'
}
ケース2:
var Action = function (row, columnfield, value, defaulthtml, columnproperties) {
return '<button (Click)="open()">EDIT</button>'
}
ケース3:
var Action = function (row, columnfield, value, defaulthtml, columnproperties) {
return '<button routerLink="user/edit/value">EDIT</button>'
}
上記のすべてのケースに失敗しました。誰でも助けてくれますか?ありがとう。あなたはjQueryのために行くか、なぜあなたはネイティブangular2でのプラグインの多くを持っているとき
私のコンポーネント、
var Action = function (row, columnfield, value, defaulthtml, columnproperties) {
return '<button>EDIT</button>'
}
this.columns = [
{
text: 'S.No', columntype: 'textbox', filtertype: 'input', datafield: 'id', width: 50, cellsalign: 'center'
},
{
text: 'FirstName', columntype: 'textbox', filtertype: 'input', datafield: 'first_name', width: 100
},
{
text: 'LastName', columntype: 'textbox', filtertype: 'input', datafield: 'last_name', width: 100
},
{
text: 'ServiceType', columntype: 'textbox', filtertype: 'input', datafield: 'servicetype', width: 50
},
{
text: 'Gender', columntype: 'textbox', filtertype: 'input', datafield: 'gender', width: 50
},
{
text: 'DateofBirth', columntype: 'textbox', filtertype: 'input', datafield: 'birthday', width: 100
},
{
text: 'Location', columntype: 'textbox', filtertype: 'input', datafield: 'formatted_address', width: 215
},
{
text: 'AdultContentPrivay', columntype: 'textbox', filtertype: 'input', datafield: 'display_adult_content', width: 100
},
{
text: 'LoginType', columntype: 'textbox', filtertype: 'input', datafield: 'logintype', width: 100
},
{
text: 'Groups', columntype: 'textbox', filtertype: 'input', datafield: 'groups_count', width: 100
},
{
text: 'Events', columntype: 'textbox', datafield: 'events_count', width: 100
},
{
text: 'Albums', columntype: 'textbox', datafield: 'albums_count', width: 100
},
{
text: 'Photos', columntype: 'textbox', width: 100
},
{
text: 'Actions', columntype: 'dropdownlist', cellsrenderer: Action, width: 100, filterable: false
},
{
text: 'More', columntype: 'dropdownlist', cellsrenderer: More, width: 100, filterable: false
}
];
を試してみてください。そのjQueryの世界から出てきてください。代わりに[** this **](https://www.primefaces.org/primeng/#/datatable)を使用してください – Aravind
こんにちはAravind、これはかなり良く見え、角度2でこれを作成したいと思います。 – MMR
私はあなたを得ません。 – Aravind