Bind foreignKey to additional custom field dropdown

So using Kanban and if we have an additional custom field using the dropdown type, such as:

dialogSettings: {
fields: [
{ key: 'Role', type: 'DropDown'}
]
}
Data in console:  
    1. data:
      1. display_name"John Doe"
      2. id"1167"
      3. reportsTo"0"
      4. role"0"
Datasource:

<script> var roles = [{"id":0,"":"Choose a Role"},{"id":1,"name":"Office Lead"},{"id":2,"name":"Team Lead"}]</script>

How can we populate that list and bind like you do in grid with foreign key?

5 Replies

HB Hareesh Balasubramanian Syncfusion Team May 19, 2020 01:54 PM UTC

Hi Mark, 

Greetings from Syncfusion Support. 

We have validated your shared code snippet at our end. And for that, we have prepared a sample using dialogSettings property. And the sample can be viewed from the following link. 

Code snippet: 
   dialogSettings: { 
    fields: [ 
      { text: 'ID', key: 'Id', type: 'Input' }, 
      { key: 'Role', type: 'DropDown' }, 
      { key: 'Estimate', type: 'Numeric' }, 
      { key: 'Summary', type: 'TextArea' } 
    ] 
  } 
 

Kindly try the above sample and revert us if you have any further assistance. 

Regards, 
Hareesh 



MA Mark May 19, 2020 01:58 PM UTC

Thank you, thats not exactly what I am looking for.  That is what I currently have but what I need is like the foreign key field of grid.  I don't want the 0,1,2,3 of Role showing, I need it to show Admin or Team Lead, etc, but I have to store the 0,1,2,3.  Is this possible?


HB Hareesh Balasubramanian Syncfusion Team May 20, 2020 02:41 PM UTC

Hi Mark, 

Thanks for the update. 

We have validated your reported query “I don't want the 0,1,2,3 of Role showing, I need it to show Admin or Team Lead, etc, but I have to store the 0,1,2,3” at our end. And for that, we have modified our previously updated sample using columns property and the sample can be viewed from the following link. 

Code snippet
  columns: [ 
    { headerText: 'Lead', keyField: '0' }, 
    { headerText: 'Admin', keyField: '1' }, 
    { headerText: 'Developer', keyField: '2' }, 
    { headerText: 'Tester', keyField: '3' } 
  ], 


Kindly try the above sample and revert us if you have any further assistance.  

Regards, 
Hareesh 



MA Mark May 22, 2020 06:12 AM UTC

This would not work for us.  We actually went full custom and solved it with this:  https://www.syncfusion.com/forums/154459/show-data-on-display-in-dialog


VM Vengatesh Maniraj Syncfusion Team May 25, 2020 04:09 AM UTC

Hi Mark, 
 
Thanks for the update. 
 
We are happy that you have solved your problem with our another discussion. 
 
Regards, 
Vengatesh 


Loader.
Up arrow icon