hide dynamic dropdown values show other json data

Posted by: bemes9226 on 18 November 2020, 10:40 pm EST

  • Posted 18 November 2020, 10:40 pm EST

    actually all columns getting dynamic data from json, but i have dropdown cell which getting dynamic numbers. but i want to show dropdown field other json data.i want hide dynamic (numbers)values and instead of that show other json data values.
    chekck below data1 column name :
    first data1 having numbers
    second json data1 having char
    i want to bind data char only. not numbers

    {
    "data1":12
    }
    separate json
    {
    data1:"datacol"
    }
    {
    data1:"datasync"
    }
  • Replied 19 November 2020, 4:39 pm EST

    Hi bemes9226,

    As per our understanding, your requirement is to bind the "data1" column to different JSON values instead of the main JSON which is bound to the data. Or do you wish to set the drop-down (DataMap or ComboBox) values of the "data1" column to different JSON values?

    Can you explain your requirements a little more so that we can provide a solution?

    Regards,
    Ashwin
  • Replied 20 November 2020, 1:12 am EST

    it is different json values to bind datamap. actually it is displaying main json values.
    i want to display different json values in the dropdown field.
    main json values is numbers
    different json values is string values
    i need to bind different json values to display.

    <wj-flex-grid-column
    *ngFor="let col of columns"
    [header]="col"
    [binding]="col"
    width="*"
    [dataMap]="(col == 'data1') ? dataVal : null "
    >
    </wj-flex-grid-column>
    when i binded data1 col i need to get other json data values in the dropdown, main json data values hide it
  • Replied 22 November 2020, 6:32 pm EST

    Hi bemes9226,

    Please refer to the sample link below:

    https://codesandbox.io/s/wijmo-angular-forked-yemex

    In the sample above, the country column is bound to numbers to but the drop-down displays string values. Can you let me know if this your requirements?

    ~regards
  • Replied 22 November 2020, 9:12 pm EST

    no, dropdown values displaying numbers, i want bind string only.this string data is separate json values. which ur provided that is displaying both number and string i want hide which is coming from dynamic data.

    this is dynamic data columns have number
    coountries=[10,20,20,40,30,20]

    i have separate json for countries
    counties=["us","uk","ind"]

    indropdown field i want get values separate json values, no need to display numbers, show and bind array of string data only
  • Replied 23 November 2020, 3:49 pm EST

    Hi bemes9226,

    You cannot bind a column to a different JSON data. The only way to display the string values instead of the numbers is to update the main JSON data (which is bound to the FlexGrid) accordingly with string values.
    Please refer to the updated sample below:

    https://codesandbox.io/s/wijmo-angular-forked-s5ekp

    ~regards
Need extra support?

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

Learn More

Forum Channels