And the selected rows marker is visible on the map,
But now i want to highlight the table row whenever click on any marker from the map, but it's not getting highlight
Below is my code
Code: Select all
const [selectedEmployee, setSelectedEmployee] = useState([]);
const setEmployeeDataId = (e) => {
for (let i = 0; i < e.length; i++) {
onTableRowClick(e[i].id); // This method is use to show marker on map
}
}
<DataTable ref={dt} value={rows} selection={selectedEmployee} onSelectionChange={(e) => {setEmployeeDataId(e.value); setSelectedEmployee(e.value);}}
dataKey="id" globalFilter={globalFilter} responsiveLayout="scroll">
<Column selectionMode="multiple" headerStyle={{ width: '2rem' }} exportable={false}></Column>
<Column header="Action" body={actionBodyTemplate} exportable={false} style={{ minWidth: '2rem' }}></Column>
<Column field="name" header="Name" sortable style={{ minWidth: '2rem' }}></Column>
<Column field="workingTime" header="Working Time" sortable style={{ minWidth: '2rem' }}></Column>
</DataTable>
</div>