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

how to set "horizontal, vertical" form of "ant form"? #207

Closed
thearabbit opened this issue Feb 28, 2017 · 9 comments
Closed

how to set "horizontal, vertical" form of "ant form"? #207

thearabbit opened this issue Feb 28, 2017 · 9 comments
Assignees
Labels
Type: Feature New features and feature requests

Comments

@thearabbit
Copy link

thearabbit commented Feb 28, 2017

how to set "horizontal, vertical" form of "ant form"?

<AutoForm
    schema={PostSchema}
    showInlineError={true}
    onSubmitSuccess={() => alert('Success!')}
    onSubmit={doc => console.log(doc)}
>
    <AutoField name="category"/>
    <AutoField name="authors"/>
    <AutoField name="publishedDate"/>
    <AutoField name="published"/>

    <SubmitField type="primary"/>
</AutoForm>

image

@janowsiany janowsiany self-assigned this Feb 28, 2017
@janowsiany janowsiany added the Type: Feature New features and feature requests label Feb 28, 2017
@janowsiany
Copy link
Contributor

janowsiany commented Feb 28, 2017

Hey @thearabbit, i think it is not handled yet. Do you want to make a pull request?
I think that FormItem has labelCol and wrapperCol properties, which will do the job here.

@radekmie
Copy link
Contributor

Also, let's call the author: @Gervwyk.

@Gervwyk
Copy link
Contributor

Gervwyk commented Feb 28, 2017

It is not handled yet. I agree with @janowsiany , labelCol and wrapperCol will be this best way to implement this - will be nice to have. I won't be able to look into this until at least next week. A PR would be great.

@thearabbit
Copy link
Author

Thanks for all reply, waiting...

@thearabbit
Copy link
Author

Could example? I tried, but don't work

render() {
        const formItemLayout = {
            labelCol: {span: 6},
            wrapperCol: {span: 14},
        };

        return (
            <div>
                <h2>Welcome to Meteor with Ant Design!</h2>

                <AutoForm
                    schema={PostSchema}
                    showInlineError={true}
                    onSubmitSuccess={() => alert('Success!')}
                    onSubmit={doc => console.log(doc)}
                >
                    <AutoField name="category" {...formItemLayout}/>
                    <AutoField name="authors" {...formItemLayout}/>
                    <DateField name="publishedDate" showTime={false} format="DD/MM/YYYY" {...formItemLayout}/>

                    <DateRangeField
                        name="publishedRangeDate"
                        showTime={false}
                        {...formItemLayout}
                    />

                    <AutoField name="published" {...formItemLayout}/>

                    <SubmitField type="primary"/>
                </AutoForm>

            </div>
        );
    }

Please help me.

@radekmie
Copy link
Contributor

radekmie commented Mar 6, 2017

It's not released yet.

@thearabbit
Copy link
Author

Oh, Thanks I will try again.

@thearabbit
Copy link
Author

Have problem with "BoolField"

Warning: Unknown props `labelCol`, `wrapperCol` on <span> tag. Remove these props from the element

@radekmie
Copy link
Contributor

radekmie commented Mar 7, 2017

Yep, that's a bug. We'll get to it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

No branches or pull requests

4 participants