apache / apache/royale-asjs

Dynamic Datagrid Columns

Open
#936 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
ActionScript
Stars
380
Forks
120
PR merge metrics
No merged PRs in 30d

Description

Looking at the Tour de Jewel "Column Swapping" example, the DataGrid toggles columns by splicing DataGridColumns initially instantiated in the markup.

Based on this, I've tried to implement dynamic DataGrid columns by creating an array of DataGridColumns objects programmatically and then assigning an array of them to Datagrid.columns ... The columns, unfortunately, do not update and I wonder if I am missing something (is there some Bead I need to add)... or is this currently not possible? The DataGrid data provider updates, but only my dummy column remains...

```









...
// The following attempts to update the Datagrid columns, but doesn't work...
// However, if I log ListTable.columns I see the change, the Datagrid itself just doesn't seem to update the
// columns even after I have successfully refreshed the dataprovider..?
var col = new DataGridColumn();
col.label = "New";
col.dataField = "new";
var columnData = [];
columnData.push(col);
ListTable.columns = columnData;
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Tour de Jewel "Column Swapping" example and the DataGrid columns property, then compare how markup-created DataGridColumn objects are attached with the programmatic assignment shown here. Check the related beads and data-provider refresh path. Done means replacing the dummy column causes the rendered DataGrid to display the new label and data field.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.