Datamap in wijmo flexgrid

Posted by: samvarth123 on 26 December 2019, 9:51 am EST

  • Posted 26 December 2019, 9:51 am EST

    We are using angular 7 with wijmo flex grid and below is the way I am populating

    below is .ts file

    this.levelTypeFormOptions = new wjcGrid.DataMap(this.countries, ‘id’, ‘name’);

    below is html file

    <wj-flex-grid-column [binding]=“‘country’”

    [dataMap]=“levelTypeFormOptions”

    [header]=“‘country’”

    [width]=“‘*’”>

    The thing is when I select a country its displaying fine but when the collectiong is getting passed its taking id.How do I pass the country name instead of Id in collection

    Right now I am sending :

    countries :[{

    “country”: “3”,state": “8”

    },{

    “country”: “4”,state": “1”

    }]

    I want the name of the country instead of the id when I send data in post request .Is that possible

  • Posted 27 December 2019, 12:39 am EST

    Hi Siva,

    You can get the name of the country by providing ‘name’ as the displayMemberPath and selectedValuePath:

    this.levelTypeFormOptions = new wjcGrid.DataMap(this.countries, 'name', 'name');
    

    But, in order to get the names using this, each country’s name should be stored in the array using the name key.

    For eg:

    [
    	{ name: 'Spain', id: 1 },
    	...
    ]
    

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels