paul-uulabs opened a new issue #936:
URL: https://github.com/apache/royale-asjs/issues/936


   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...
   
   ```
   <j:DataGrid id="ListTable">
                   <j:beads>
                       <j:RemoveAllDataGridItemRendererForArrayListData/>
                       <j:DataGridColumnLabelsChange/>
                       <js:ConstantBinding
                                                                        
sourceID="tablesModel"
                                                                        
sourcePropertyName="tableData"
                                                                        
destinationPropertyName="dataProvider"/>
                   </j:beads>
                   <j:columns dragEnabled="true" allowMultipleSelection="true">
                        <!-- I included 1 dummy column initially, but this will 
be replaced with dynamically generated colums-->
                        <j:DataGridColumn label="Dummy" dataField="dummy"  />
                   </j:columns>
   </j:DataGrid>
   
   ... 
   // 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;
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to