glideapps / glideapps/glide-data-grid

Unable to Change Custom Cell Values (Dropdown)

Open
#773 3 comments 0 reactions 0 assignees View on GitHub
package:cells type:bug
Dominant language
TypeScript
Stars
5.3k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

**Problem:**
Hey team, I am experiencing an issue in which I cannot change the values of custom cells, specifically dropdowns, in my application. Despite the console logs showing the correct value, the changes are not being reflected in the dropdowns.
The edit functionality of other cells is working as expected and this is happening with custom cells. Would request further information on handling the edit of custom cells in glide-apps-grid.
Let me know if any further information is required. Thank you

Here is the on-cell edited function:
```
// Sample code that demonstrates how the update is attempted
const onCellEdited = (cell: Item, newValue: CustomCell) => {
const [col, row] = cell;
const attribute = attributes[col];

if (newValue.kind === "custom" && newValue.data.kind === "dropdown-cell") {
const dropdownValue = newValue.data.value;

// Update the dropdown value in indicatorRecord
setIndicatorRecord((prevRecords: IndicatorRecord[]) => {
const newRecords = [...prevRecords];
newRecords[row] = {
...newRecords[row],
[attribute.name]: dropdownValue,
};
return newRecords;
});
}
// ...
};

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.