angular-dynamic-forms icon indicating copy to clipboard operation
angular-dynamic-forms copied to clipboard

Increase the size of Multi select list box

Open skprasadu opened this issue 9 years ago • 6 comments

Dan,

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

Krishna

skprasadu avatar Nov 13 '15 20:11 skprasadu

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"
  }
];

danhunsaker avatar Nov 13 '15 23:11 danhunsaker

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 avatar Nov 14 '15 00:11 skprasadu

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

skprasadu avatar Nov 26 '15 03:11 skprasadu

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.

danhunsaker avatar Nov 26 '15 07:11 danhunsaker

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,

skprasadu avatar Nov 27 '15 16:11 skprasadu

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

skprasadu avatar Nov 27 '15 16:11 skprasadu