How to show a row as a highlight while selected ids are getting from Props

UI Components for React
Post Reply
r1851
Posts: 2
Joined: 26 Dec 2022, 07:20

26 Dec 2022, 09:29

I have added an array of employees into the Datatable, while clicking on each row the selected row is highlighted in the table
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>
While clicking on the map marker all selected marker ids are stored in props.employeeMarkerUIConfig, but I am not able to highlight these ids on the map

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

29 Dec 2022, 21:54

PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests