Skip to content

Can I replace a specific cell (row:2 , column2 etc) with a custom component? #67

Answered by chairedevil
chairedevil asked this question in Q&A
Discussion options

You must be logged in to vote

I handle with this way.

{ ...keyColumn('test', textColumn), title: 'TEST', component: TestInput },

const TestInput = (data: any) => {
  let input
  if (data.rowData.type === 0) {
    input = <input type="text" value={data.rowData.test} />
  } else {
    input = <input type="text" value={data.rowData.test} style={{ backgroundColor: 'red' }} />
  }
  return data.focus ? input : <div>{data.rowData.test}</div>
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by nick-keller
Comment options

You must be logged in to vote
1 reply
@chairedevil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants