igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Dynamic Multicolumn header

Open Dineshreddy73 opened this issue 7 years ago • 13 comments

Hi,

We are working with the remote data where we are getting the data dynamically and for that we need multi column header. So could you please help me out with the issue.

Thanks in Advance, Dinesh.

Dineshreddy73 avatar Mar 26 '19 12:03 Dineshreddy73

@Dineshreddy73 Hi we already have multi column header for the data grid and it should work with remote data as well. You can check it here: https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/multi_column_headers.html

SlavUI avatar Mar 26 '19 13:03 SlavUI

@Dineshreddy73 Can you provide a sample of your code and tell us what's not working with your current setup and remote data?

kdinev avatar Mar 26 '19 15:03 kdinev

@Dineshreddy73 Hi do you have any comments ?

SlavUI avatar Apr 01 '19 11:04 SlavUI

Hello,In the above example you shared, the column headers e.g General Information and Company Name were created statically in the html page (i.e column names and number of columns are fixed). So i just wanted to know either we do the same thing dynamically ? (Column names and number of columns are not fixed every time we load the page and must be populated dynamically say from .ts file)

SaranyaDwarampudi avatar Apr 03 '19 08:04 SaranyaDwarampudi

@SaranyaDwarampudi Yes, as long as you have objects that describe your columns, you can *ngFor the <igx-column> definition and assign the configuration from your column objects.

kdinev avatar Apr 03 '19 08:04 kdinev

@kdinev Can you please provide me an example ?

SaranyaDwarampudi avatar Apr 03 '19 08:04 SaranyaDwarampudi

@SaranyaDwarampudi you can look at this sample. There the columns has field 'group' and base on it the columns are added to the columns groups dynamically: https://stackblitz.com/edit/angular-wymx5x-4efpyd?file=src/app/grid/multi-column-headers/multi-column-headers.html

nrobakova avatar Apr 03 '19 11:04 nrobakova

@nrobakova Thank you for the example. Our requirement is like,we will use 2 tables. So i am explaining you based on the example you have provided. First table will have only the columns names to populate the Group1,Group2,Group3 column names(names change every-time) and Second table is used used to populate the the column names like region and so on and its respective data. So from the second table(from region column) everything looks fine, but the groups must also be populated dynamically and the groups may also increase in some cases(Group1,Group2,Group3 in some cases and Group1,Group2,Group3,Group4).

SaranyaDwarampudi avatar Apr 03 '19 12:04 SaranyaDwarampudi

@SaranyaDwarampudi can you send a small sample(set of data) for how tables looks like. In the sample the first grid(grid1) uses one list for column groups and one for the columns, so the column groups may increase.

nrobakova avatar Apr 03 '19 12:04 nrobakova

SampleData.xlsx @nrobakova Please find the sample data. In relation to the example you have provided, the first table in the excel sheet is used to populate the columns (Group1,Group2,Group3) and the second table is used to populate the columns like region and its data.The third table in the excel sheet tells you how the table should look like.

SaranyaDwarampudi avatar Apr 04 '19 06:04 SaranyaDwarampudi

@SaranyaDwarampudi when you have the columns and groups you can always use the *ngFor to show them in the way that you want. I here is the updated sample and hope this will help you: https://stackblitz.com/edit/angular-wymx5x-ec52ja?file=src/app/grid/multi-column-headers/multi-column-headers.html

nrobakova avatar Apr 04 '19 07:04 nrobakova

@SaranyaDwarampudi does the sample help you to resolve your scenario? Can I close the issue

nrobakova avatar Apr 11 '19 06:04 nrobakova

@SaranyaDwarampudi closing this one reopen if needed

SlavUI avatar May 07 '19 07:05 SlavUI