FlexGrid Angular2 - Select column

Posted by: rharvey on 19 January 2018, 1:02 am EST

    • Post Options:
    • Link

    Posted 19 January 2018, 1:02 am EST

    Hello,

    I have a grid displaying data, I want the end user to be able to select a column from the grid. With the column selected I only need the column index (eg 0 for the first column) and the column header and binding details.

    <wj-flex-grid [itemsSource]="cvPaging" #flex style="height:292px">
      <wj-flex-grid-column *ngFor="let object of data" 
                  [header]="object.display" 
                  [binding]="object.source"  
                  [allowSorting]="false"></wj-flex-grid-column>
    </wj-flex-grid>
    

    Any ideas?

  • Posted 21 January 2018, 7:17 pm EST

    Hi,

    You may get the selected column index by selection.col property. For e.g. you select second column in FlexGrid and now getting selected column index on a button click.

    getColumnIndex:number(grid:wjGrid.FlexGrid){
    	return grid.selection.col;
    }
    

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels