Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 剑道反应ui树专家如何在不同层次上定制单元? 类TableCell扩展了React.Component{ render(){ const{dataItem,field}=this.props const cellData=this.getFieldValue(数据项,字段) 常量{participantType}=dataItem 让样式={position:'relative'} 交换机(参与者类型){ “直接”案例: 样式={ fontSize:'14px', } 打破 “间接”一案: 样式={ fontSize:'14px', fontStyle:'斜体', } 打破 “可寻址”案例: 样式={ fontSize:'13px', fontStyle:'斜体', } 打破 } 返回( {cellData} ) } }_Reactjs_Kendo Ui_Kendo Treelist_Kendo React Ui - Fatal编程技术网

Reactjs 剑道反应ui树专家如何在不同层次上定制单元? 类TableCell扩展了React.Component{ render(){ const{dataItem,field}=this.props const cellData=this.getFieldValue(数据项,字段) 常量{participantType}=dataItem 让样式={position:'relative'} 交换机(参与者类型){ “直接”案例: 样式={ fontSize:'14px', } 打破 “间接”一案: 样式={ fontSize:'14px', fontStyle:'斜体', } 打破 “可寻址”案例: 样式={ fontSize:'13px', fontStyle:'斜体', } 打破 } 返回( {cellData} ) } }

Reactjs 剑道反应ui树专家如何在不同层次上定制单元? 类TableCell扩展了React.Component{ render(){ const{dataItem,field}=this.props const cellData=this.getFieldValue(数据项,字段) 常量{participantType}=dataItem 让样式={position:'relative'} 交换机(参与者类型){ “直接”案例: 样式={ fontSize:'14px', } 打破 “间接”一案: 样式={ fontSize:'14px', fontStyle:'斜体', } 打破 “可寻址”案例: 样式={ fontSize:'13px', fontStyle:'斜体', } 打破 } 返回( {cellData} ) } },reactjs,kendo-ui,kendo-treelist,kendo-react-ui,Reactjs,Kendo Ui,Kendo Treelist,Kendo React Ui,这是对不可展开的列的工作。如果我与“可扩展的”列一起使用,则它是重新排序的,但扩展/折叠行为是过度的,用于扩展的箭头将消失 是否有可能以另一种方式自定义单元格???帮助我的答案是TreeList道具rowRender rowRender?(行:ReactElement,道具:TreeListRowProps)=>React.ReactNode 它帮助我根据一行的数据设置一行中所有单元格的样式。 可以使用React.cloneElement覆盖当前行,并添加一些额外的道具,如样式 class Ta

这是对不可展开的列的工作。如果我与“可扩展的”列一起使用,则它是重新排序的,但扩展/折叠行为是过度的,用于扩展的箭头将消失


是否有可能以另一种方式自定义单元格???

帮助我的答案是TreeList道具rowRender

rowRender?(行:ReactElement,道具:TreeListRowProps)=>React.ReactNode

它帮助我根据一行的数据设置一行中所有单元格的样式。 可以使用React.cloneElement覆盖当前行,并添加一些额外的道具,如样式

class TableCell extends React.Component {

  render() {
    const { dataItem, field } = this.props

    const cellData = this.getFieldValue(dataItem, field)

    const { participantType } = dataItem
    let styles = { position: 'relative' }

    switch (participantType) {
      case 'direct':
        styles = {
          fontSize: '14px',
        }
        break
      case 'indirect':
        styles = {
          fontSize: '14px',
          fontStyle: 'italic',
        }
        break
      case 'addressable':
        styles = {
          fontSize: '13px',
          fontStyle: 'italic',
        }
        break
    }

    return (
      <td style={styles}>
        <span>{cellData}</span>
      </td>
    )
  }
}