Fomantic-ui: Dropdown avatar with remote content

Created on 12 Jul 2019  路  2Comments  路  Source: fomantic/Fomantic-UI

Hello! it's possible that inside the expected server response, the dropdown module can receive inside the json a property for the avatar url?

For example:

// Expected server response
{
    "success": true,
    "results": [
      {
        // name displayed in dropdown
        "name"  : "Choice 1",
         // selected value
        "value" : "value1",
         // name displayed after selection (optional)
        "text"  : "Choice 1",
         // whether field should be displayed as disabled (optional)
        "disabled"  : false,
        "avatar": "url to image"
       },
      {
        "name"  : "Choice 2",
        "value" : "value2",
        "text"  : "Choice 2",
        "avatar": "url to image"
      }
  ]
}

Thanks for the great job.

lanjavascript typfeat

Most helpful comment

Implemented by #875
Play with it here https://jsfiddle.net/en6dwvqc/
I implemented a more generic approach (image instead of avatar) because there are more possibilities images may be used within a dropdown than avatars. See PR for explanation.

All 2 comments

This would produce a dropdown like this https://jsfiddle.net/26a0jqzd/

Implemented by #875
Play with it here https://jsfiddle.net/en6dwvqc/
I implemented a more generic approach (image instead of avatar) because there are more possibilities images may be used within a dropdown than avatars. See PR for explanation.

Was this page helpful?
0 / 5 - 0 ratings