0

DataTable object extend if i click arrow button.But i need this ,wherever I click, the row should expand. Is there any way to do so?

This is the line and arrow button This is the example code of DataTable

<DataTable value={products} expandedRows={expandedRows} onRowToggle={(e) => setExpandedRows(e.data)}
        onRowExpand={onRowExpand} onRowCollapse={onRowCollapse} rowExpansionTemplate={rowExpansionTemplate}
        dataKey="id" header={header} tableStyle={{ minWidth: '60rem' }}>
    <Column expander={allowExpansion} style={{ width: '5rem' }} />
    <Column field="name" header="Name" sortable />
    <Column header="Image" body={imageBodyTemplate} />
    <Column field="price" header="Price" sortable body={priceBodyTemplate} />
    <Column field="category" header="Category" sortable />
    <Column field="rating" header="Reviews" sortable body={ratingBodyTemplate} />
    <Column field="inventoryStatus" header="Status" sortable body={statusBodyTemplate} />
</DataTable>

I tried to active onRowClick={extends} ,also try to functionalized this event but fail. onSelectedRow={(e) => setExpandedRows(e.data)} event doesnt work either.

yokbi
  • 23
  • 4

0 Answers0