【问题标题】:Inline editing in fixed data table 2固定数据表 2 中的内联编辑
【发布时间】:2018-11-02 03:01:53
【问题描述】:

我正在使用固定数据表 2 来呈现 JSON 对象。 当我单击行上的按钮时,我想向表的行添加内联编辑。

我已经浏览了链接上的文档:

http://schrodinger.github.io/fixed-data-table-2/

但是我找不到在固定数据表中创建内联编辑的文档。

【问题讨论】:

  • 您的意思是,您想在单击按钮时编辑一行?
  • @RohithMurali。是的

标签: reactjs fixed-data-table


【解决方案1】:

若要这样编辑行,您必须在单击该行的按钮时有条件地更改单元格组件以包含<input value={...}/>

const MyCustomCell = ({ isEditing}) =>
      <Cell>
        {isEditing? "222" : <input value="222" type=number/>}
      </Cell>;


    <Column
      header={<Cell>Col 3</Cell>}
      cell={<MyCustomCell isEditing/>}
      width={2000}
    />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-02
    • 1970-01-01
    • 2018-09-22
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 2015-11-09
    • 1970-01-01
    相关资源
    最近更新 更多