antd

How to also transfer the children across the component?

别来无恙 提交于 2019-12-24 22:17:00
问题 I am working with the antd's transfer component and antd's table component. I have a table inside the transfer component, where each row could have multiple children. Currently, I am able to transfer parents across the transfer component. Is there a way, I could also transfer children across the transfer component? I currently could not understand how to do this. I have also created a small working example on The component in the sandbox looks as : Currently, I am able to transfer the row

Having a tree structure on both sides of the Transfer component

我怕爱的太早我们不能终老 提交于 2019-12-24 20:24:28
问题 I am using antd's Transfer component. Using the examples given in the documentation, I am able to create a tree transfer box that looks similar to: Is there a way I could have a tree structure also on the right side? Currently, as I select 0-1-0 under 0-1 , it appears flat on the right side. The code as also given in the Sandbox example, is given below: import React from 'react'; import ReactDOM from 'react-dom'; import 'antd/dist/antd.css'; import './index.css'; import { Transfer, Tree }

Ant Select closes dropdown

南笙酒味 提交于 2019-12-24 18:59:26
问题 I am using Ant Select component inside Dropdown component. Here is my index file which renders Dropdown const getMenu = filter => ( <MenuContainer ... /> ); <Dropdown overlay={getMenu(searchFilter)} trigger={['click']} visible={this.state.search} onVisibleChange={val => this.handleDropdownVisibility(val, searchFilter) } > ... </Dropdown> Here is my MenuContainer which return Select Component inside it handleSelectChange = val => { this.setState({ selectedValue: val, }); }; <Select ref=

Input onchange checker if data exist in JSON data

白昼怎懂夜的黑 提交于 2019-12-24 11:18:58
问题 I have a user requirement when adding a form it should check if the name of the form is already exist. How can I do that in es6? I'm using AntDesign and ReactJS. Here's my code <Form.Item label="Form Name"> {getFieldDecorator('formName', { rules: [formConfig], })(<Input name="formName" onChange={onChange} />)} </Form.Item> const handleChange = e => { const { name, value } = e.target; setState(() => ({ ...state, [name]: value, })); let isExist = [...formDataSource]; let foundExistItem =

Why is not tree checkboxes checked in the child component using Ant Tree Design

穿精又带淫゛_ 提交于 2019-12-24 07:41:13
问题 I'm trying to figure out what I'm doing wrong using this Ant Tree component. I have two components, the PageAdmin I do a get call to get information about what nodes in the tree that should be marked as selected. I receive the data from the server and put it in the array checkedKeys and send it to the child component as props CustomTree and I can see the props for the CustomTree component are correctly updated, but the nodes in the tree are NOT selected, plus when I selected another node the

Antd - is there anyway to change background color of the Card title?

时光总嘲笑我的痴心妄想 提交于 2019-12-24 04:14:08
问题 By adding the style attribute I can only change the color of the body part of the Card component. How can I change the title part as well? <Card title='Card title' bordered loading={this.onLoading()} style={{ backgroundColor: '#aaaaaa' }}> <Row type='flex' justify='center'> <h1>Card content</h1> </Row> </Card> 回答1: The following worked for me. I had to remove the background color of the entire card and set a different background color both for the Head and Body content: <Card title="Track

How to set and get a datepicker value using antd with formik?

一笑奈何 提交于 2019-12-24 00:38:27
问题 Here i am creating Datepicker with antd and passing this antd datepicker to formik field.My sample code for Datepicker with antd import React from "react"; import { Form, DatePicker } from "antd" import { Field } from "formik"; import moment from 'moment'; const FormItem = Form.Item; function onChange(date, dateString) { console.log(date, dateString); } const dateFormat = "MM-DD-YYYY" // Here i am adding antd error message through DateInput const DateInput = ({ field, form: { touched, errors

How to import svg into antd -> Icon component

♀尐吖头ヾ 提交于 2019-12-23 17:41:54
问题 Hey I am trying to import my own svg into antd -> Icon component like in the documentation but i got an exception InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/archive-solid.3c305173.svg') is not a valid name. Im using create react app 2.1.1 and antd version 3.10.3 I would not want to do the create react app eject and i dont access to webpack any ideas. that the code: import React, { Component } from "react"; import { Layout,

Hide element with antd (Ant Design Grid)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 07:30:09
问题 I want to hide some divs when it hit certain breakpoints, in bootstrap v4 there is something like: hidden-sm-down After reading the Grid documentation, setting <Col xs={0}></Col> may be the solution here is my example: http://codepen.io/kossel/pen/BQgzNg?editors=0110 However expected with only xs={0} would hide the sidebar at XS view, but it hidden at every screen size, the solution/hack is to put add another breakpoint like sm={1} to make it work as expected. What is the correct way to do

Configuring word-wrap in column header of an Antd Table

亡梦爱人 提交于 2019-12-23 05:20:03
问题 I already spent too much time searching on how to configure the column headers of Antd tables, in the official Antd table docu and elsewhere, but I was not successful: Is there a simple way of adjusting the word-wrap of the column header? Right now, if the column is too small (e.g. when resizing the browser window), letters are floating into new lines in an uncontrolled manner. English hyphenation would be cool, but for a start I would appreciate having 2 or 3 ellipsis dots instead of freely