我遇到一种情况,需要编辑手风琴级别的标题...目前,我仅在打开级别时才允许对其进行编辑。
是否可以在同一标题行中进行操作而无需打开关卡?
我发现可以自定义内容,但是现在我遇到了在标题内显示textinput的问题,它将其换行了!
代码段:
populateProperties() {
lvl1Items = [];
elementsLevel1.forEach((item) => {
lvl1Properties = this.buildProperties(item.Properties, PROPERTIES, false, 1)
lvl1Items.push(
{key: item.Name,
title: {
content:
<span>
<List16 className="icon--alignment--2"/> {item.Name}
<Edit16 className="icon--alignment--2" onClick={() => alert("Edit")}/>
<table>
<tbody>
<tr>
<td width="30%">
<TextInput
id="txtLvl1"
labelText=""
placeholder=""
required
defaultValue={item.Name}
// disabled={}
// onChange={ e => this.handleNewProjectNameChange(e) }
/>
</td>
</tr>
</tbody>
</table>
</span>,
// icon: 'bars',
},
// title:item.Name,
content: lvl1Content}
)
});
//TODO - it was designed to work as "On Demand" to display different levels
// but currently api retrieves everything at once, so it's not needed.
this.buildLevel2()
this.buildLevel3()
this.setState({lvl1Items: lvl1Items})
}