Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

Width of the fields when grouping #19

Open
ColadaFF opened this issue Jan 15, 2016 · 7 comments
Open

Width of the fields when grouping #19

ColadaFF opened this issue Jan 15, 2016 · 7 comments

Comments

@ColadaFF
Copy link

Hi there,

I tried to use the material templates, but when I try to use it grouping fields to get like 3 fields in the same row, I don't see how can I set the width for the fields, so when it renders, I get this:
screen shot 2016-01-15 at 6 23 00 pm

and this is my configuration:

{
                elementAttributes: {
                    "layout": "row"
                },
                fieldGroup: [
                    {
                        key: 'existId',
                        type: 'select',
                        templateOptions: {
                            label: "¿Presenta documento de identificación?",
                            placeholder: 'Seleccione..',
                            options: [
                                {key: 'default', value: labelsContact.options.defaultSelect},
                                {key: '1', value: labelsContact.options.yes},
                                {key: '2', value: labelsContact.options.no},
                                {key: '3', value: labelsContact.options.process}
                            ],
                            valueProp: 'key',
                            labelProp: 'value',
                            "required": true

                        },
                        validators: selectDefaultValidator
                    },
                    {
                        key: 'idType',
                        type: 'select',
                        templateOptions: {
                            label: "",
                            placeholder: 'Seleccione..',
                            options: [],
                            valueProp: 'key',
                            labelProp: 'value',
                            "required": true
                        }
                    },
                    {
                        key: 'idNumber',
                        type: 'input',
                        templateOptions: {
                            label: labelsContact.fields.idNumber,
                            "required": true
                        }
                    }
                ]
            }

How can I handle this with material templates?

Thanks.

@kamilkisiela
Copy link
Collaborator

@ColadaFF I'm going to look it up in few days.

@kamilkisiela
Copy link
Collaborator

@ColadaFF Take a look at this http://angular-formly.com/#/example/other/advanced-layout-flex

I prepared playground of your example.
http://codepen.io/kamilkisiela/pen/mVqjZP

The problem is related to ngMaterial.
<md-input-container> has two children: <label> and <md-select>.
<label> (which contains templateOptions.label) has the same width as <select>.
So you can try to add custom css.

@jmls
Copy link

jmls commented Feb 13, 2016

I have a similar problem :
http://codepen.io/anon/pen/JGxLGr

how do I make field1 50% and field2 50% of the width ?

@jmls
Copy link

jmls commented Feb 27, 2016

anyone got any ideas ?

@jmls
Copy link

jmls commented Mar 1, 2016

ok, 17 days without any response on this or another question - so I have to ask - is this project dead ? If so, please just say so that we don't waste time evaluating this.

@kamilkisiela
Copy link
Collaborator

@jmls It's not dead. I've got lot of stuff happening but now I'm back.

ngMaterial changed something in css so it has to be fixed now. I'm going to work on it at the end of today.

@jmls
Copy link

jmls commented Mar 2, 2016

you da man ;) thanks

@kamilkisiela kamilkisiela added this to the v1.0.0 milestone Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants