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

Increase the size of Multi select list box #60

Open
skprasadu opened this issue Nov 13, 2015 · 6 comments
Open

Increase the size of Multi select list box #60

skprasadu opened this issue Nov 13, 2015 · 6 comments

Comments

@skprasadu
Copy link

Dan,

I want to increase the size of multi select list box. Default size of 4. Is there a way?

Krishna

@danhunsaker
Copy link
Owner

The same way you would in HTML - use the "size" attribute:

template = [
  {
    "type": "select",
    "model": "select",
    "label": "select",
    "empty": "nothing selected",
    "multiple": true,
    "attributes": {
      "size": 16
    },
    "autoOptions": "item.value as item.label for item in items"
  }
];

@skprasadu
Copy link
Author

Dan, Thanks for your quick reply. I will try this alternative. For now I controlled the size through generic CSS as below,

select[multiple] {
height: 200px;
}

We extensively use your framework while building a quick prototype. This framework is one of the most well thought out one in creating dynamic UI. Great work.

Shortly I will build a small tutorial on how to build a decent crud based application using spring boot and dynamic forms. Please see if you can accept the pull request.

Thanks once again.
Krishna

@skprasadu
Copy link
Author

One more question, how to force someone to select select an element from dropdown, I did set required field to true, but when I am processing, it is just accepting if an item is not selected.

Please help me on this.

Krishna

@danhunsaker
Copy link
Owner

I'm not sure why that's not working... One thing to note is that the required key creates an ng-required attribute on the form element, so the value there needs to follow the format for that. If you want the required attribute instead, use attributes.required instead.

@skprasadu
Copy link
Author

When I am setting attributes a control, for example select, it is setting to the label of that control. Not the control itself. Can you fix this issue? for example,

Citizen Country Group  Country Group  Name 

<select class="ng-pristine ng-valid" name="citizen_country_group__country_group_id" ng-model="urlFormData['citizen_country_group__country_group_id']"></select>

when the data cameback, it looked as below,

"citizen_country_group__country_group_id":{"label":"Citizen Country Group Country Group Name","type":"select","options":{"8":{"label":"APAC"}},"attributes":{"ng-change":"if(urlFormData['citizen_country_group__country_group_id'] != 0) urlFormData['citizen__country_id'] = 0"}}

See if there is a fix.

@skprasadu
Copy link
Author

I realized that I can use a 'callback' and not use attributes. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants