Comments (2)
To implement sorting by email and name for the People object, follow these steps:
-
Update Sorting Logic:
- Modify the sorting logic in
src/components/PeopleTable/PeopleTable.js
to include sorting by email and name.
// Add sorting functions const sortByEmail = (a, b) => a.email.localeCompare(b.email); const sortByName = (a, b) => a.name.localeCompare(b.name); // Update sorting logic const handleSort = (column) => { let sortedData; switch (column) { case 'email': sortedData = [...data].sort(sortByEmail); break; case 'name': sortedData = [...data].sort(sortByName); break; default: sortedData = [...data]; } setData(sortedData); };
- Modify the sorting logic in
-
Update Column Header Menu:
- Ensure the column header menu in
src/components/PeopleTable/PeopleTableHeader.js
allows sorting by email and name.
// Add menu items for sorting <MenuItem onClick={() => handleSort('email')}>Sort by Email</MenuItem> <MenuItem onClick={() => handleSort('name')}>Sort by Name</MenuItem>
- Ensure the column header menu in
-
Handle Click Events:
- Update the click event handler in
src/components/PeopleTable/PeopleTableHeader.js
to open the column header menu when clicking anywhere on the first column header except the "+" icon.
const handleHeaderClick = (e) => { if (!e.target.closest('.plus-icon')) { openColumnHeaderMenu(); } };
- Update the click event handler in
-
CSS Adjustments:
- Ensure the CSS in
src/components/PeopleTable/PeopleTableHeader.css
supports the new click behavior.
.plus-icon { pointer-events: none; }
- Ensure the CSS in
References
from twenty.
same!
from twenty.
Related Issues (20)
- Improve Relation Picker Loading Sequence HOT 1
- Duplicated rating field on frontend HOT 1
- Rating field cannot be edited if it's empty HOT 2
- Save last view as the default view when I come back HOT 3
- Create a command to trigger the import of a single message HOT 1
- Refactor RecordTableCellContainer to avoid re-render between soft focus and display mode HOT 1
- Column header menu Filter button doesn't work HOT 4
- Adjust Table Header Hover Background Color HOT 5
- Menu Items Order Should Match Table Column Headers Order HOT 3
- Change Email Sync Status Display from "Complete" to "Active" HOT 5
- Missing email tab in opportunity HOT 1
- Migrations get stuck due to a confirmation prompt HOT 1
- fix position first argument not wanted in api rest api HOT 1
- API should not accept null value for non-nullable fields HOT 1
- Show Kanban view creation when we go back from creating a select field from settings. HOT 5
- Add Tooltips to Kanban Card Icons for Better Clarity HOT 1
- bug: Loosing table cell focus after clicking filter/sorrt buttons HOT 1
- Add Chevron Icon to Indicate Submenu on "Fields" Menu Item HOT 2
- Add Stage Management and "No Value" Column to Kanban HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twenty.