▼環境
@angular/cli: 1.2.7
node: 8.2.1
typescript: 2.5.3
知りたいこと:
Angularのui-grid機能を使って商品一覧を表示させていますが、
任意の商品が選択された時にこの商品とある条件が一致するその他商品を
全て自動選択させることが出来か、、です。
例:任意商品が選択されチェックボックスが選択された時、
(PCだと任意のCellがクリックされればその行が選択状態になります)
下記ソースのようにthisCellが同じ商品を全て選択状態にして
次の画面に遷移した時にこれらの選択商品情報を一覧表示したいです。
grid実装でgridOptionsは次のように設定しています。
※checkboxSelectionをtrueにしているためチェックボックスが表示される状況です。
Angular
1this.gridOptions = <GridOptions>{ 2 enableFilter: true, 3 enableRangeSelection: true, 4 rowSelection: 'multiple', 5 localeText: environment.gridLocale, 6 getContextMenuItems: this.getContextMenuItems, 7 }; 8 this.gridOptions.columnDefs = [ 9 { 10 headerName: '', 11 headerCheckboxSelection: true, 12 headerCheckboxSelectionFilteredOnly: true, 13 width: 40, 14 checkboxSelection: true, 15 suppressSorting: true, 16 pinned: true, 17 }, 18 { 19 headerName: '任意のヘッダー名', 20 field: 'FieldId', 21 sort: 'desc', 22 width: 50, 23 }, 24 { 25 headerName: 'このセル', 26 field: 'thisCell', 27 sort: 'desc', 28 width: 50, 29 }, 30 { 31 '・・・: ・・・' 32 }, 33 ]; 34 this.height = window.innerHeight - 80; 35 if (this.production) { 36 this.backgroundColor = 'primary'; 37 } else { 38 this.backgroundColor = 'warn'; 39 } 40
あなたの回答
tips
プレビュー