Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown avatar with remote content #872

Closed
aldebaran798 opened this issue Jul 12, 2019 · 2 comments
Closed

Dropdown avatar with remote content #872

aldebaran798 opened this issue Jul 12, 2019 · 2 comments
Assignees
Labels
lang/javascript Anything involving JavaScript type/feat Any feature requests or improvements
Milestone

Comments

@aldebaran798
Copy link

aldebaran798 commented Jul 12, 2019

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.

@y0hami y0hami added type/feat Any feature requests or improvements lang/javascript Anything involving JavaScript tag/good-first-issue Good issues for new starters to try labels Jul 12, 2019
@y0hami
Copy link
Member

y0hami commented Jul 12, 2019

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

@lubber-de lubber-de self-assigned this Jul 12, 2019
@lubber-de lubber-de removed the tag/good-first-issue Good issues for new starters to try label Jul 12, 2019
@lubber-de lubber-de added this to the 2.7.7 milestone Jul 12, 2019
@lubber-de
Copy link
Member

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.

@lubber-de lubber-de added the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Jul 15, 2019
@y0hami y0hami closed this as completed in f033782 Jul 28, 2019
@lubber-de lubber-de removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/feat Any feature requests or improvements
Projects
None yet
Development

No branches or pull requests

3 participants