我有这样一个代码:
<Editor source="/api/customer" onCreate={this.debugChange} onDelete={this.debugChange} onUpdate={this.debugChange}>
<Group title="Address">
<Column id="id" label="ID" default={0} readonly />
<Column id="name" label="name" default="" />
<Column id="address" label="Address" default="" />
<Column id="country" label="Country" default={currentCountry} readonly source="/api/country" idfield="id" captionField="name" />
</Group>
<Group title="Payment">
<Column id="tax" label="TaxType" default={0} source="/api/taxtype" idfield="id" captionField="name" />
<Column id="bank" label="Bank" default="" source="/api/banks" idfield="id" captionField="bank"/>
<Column id="account" label="Account Number" default="" />
</Group>
</Editor>
编辑有一个
render()
let components = React.Children.map(this.props.children, (child) => {
return <Column {...child.props} default={row[child.props.id]} onChange={this.onChange.bind(this)} />
})
return <div className="hx-editor">
<div className="hx-editor-list">
<List id={this.props.id + "-list"} source={this.props.source}
singleShow captionField={this.caption.bind(this)}
groupfn={this.props.group} onSelect={this.onSelect.bind(this)} />
</div>
<form name={"hx-form-" + this.props.id} className="hx-form">
{components}
{buttons}
</form>
</div >
我现在有这样的功能
<List>
的
onSelect
private onSelect(id: string, data: T) {
this.setState({
currentRow: data,
modifiedRow: data
})
}
<Editor>
将显示来自的列表
/api/customer
<列表>
当选
道具,这些道具反过来会更新所有道具
<Column>
data = [{
id: 0,
name: 'My Customer',
address: 'This is Address',
country: 'US',
tax: '010',
bank: 'HSBC',
account:: '89238882839304'
}, ... ]
我放在这里的这个方法,只适用于直接受教育的儿童
<
,但不在
<Group>
我的问题是,我怎样才能深入更新
<列>
作为
<编辑>
当用户单击中的值时的子项
<
. 我是说,表演
<
搜索所有子项,并更新所有值,无论它们位于何处,只要在
<
标签。
感谢您的帮助。非常感谢。