gregnb / gregnb/mui-datatables

How can we iterate over rows and click/select a row based on its data?

Open
#1,362 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I'm rewriting a project from jQuery to React and is currently using `MUI-datatables` library - it is a really great and comprehensive tool.

Now, I'm trying to find a solution on how we can select/click a particular row based on the row data, this is how it was done in the jQuery datatables:

```
var id = 5; // Hardcoded for a showing purposes
table.rows().iterator('row', function (context, index) {
var data = this.row(index).data();
if (data[3] === id) {
$('#' + listTableId + ' tr[data-id="' + id + '"]').click();
}
});
```
Here we have access to the rows data by iterating over rows and checking rows 4th parameter.
How this could be done in the MUI-datatables?
Thanks in advance
We are iterating over rows data and clicking it if

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names MUI-datatables and provides a jQuery DataTables example, but it names no repository file, test, or implementation entry point. Start by locating the table row-selection and row-data APIs in MUI-datatables, then determine whether the requested data-based selection is supported and how completion would be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.