Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 在数据网格中设置值_Apache Flex_Datagrid_Cell - Fatal编程技术网

Apache flex 在数据网格中设置值

Apache flex 在数据网格中设置值,apache-flex,datagrid,cell,Apache Flex,Datagrid,Cell,您知道如何在数据网格中的单元格级别设置值吗 我使用了以下方法 私有函数数据面板(rowindex:Number,Var1:Number,Var1Name:String,Var2:Number,Var2Name:String,Var3:Number,Var3Name:String,Var4:Number,Var4Name:String):void{ 跟踪(“行索引”,行索引) 如果(rowindex==0){ col1、col2、col3、col4是数据网格中4列的id 每行中值的行索引增量 它编

您知道如何在数据网格中的单元格级别设置值吗

我使用了以下方法

私有函数数据面板(rowindex:Number,Var1:Number,Var1Name:String,Var2:Number,Var2Name:String,Var3:Number,Var3Name:String,Var4:Number,Var4Name:String):void{ 跟踪(“行索引”,行索引)

如果(rowindex==0){

col1、col2、col3、col4是数据网格中4列的id 每行中值的行索引增量


它编译后,我得到一个错误-当我尝试分配col1[]时,它得到一个奇怪的错误。我如何实现这一点?

使用数据字段属性

       <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{employees}">
            <mx:columns>
                <mx:DataGridColumn dataField="Var1" headerText="Var1Name"/>
                <mx:DataGridColumn dataField="Var1" headerText="Var1Name"/>
                <mx:DataGridColumn dataField="Var1" headerText="Var1Name"/>
            </mx:columns>
        </mx:DataGrid>

我从脱机来源找到了答案。您将datagrid设置为从arraycollection获取值,并在arraycollection中填充值


如果有人需要,我可以分享更多细节…

Thaks Adrian-但这对我来说不起作用…我需要能够按行引用…从这个意义上说,我有能力进行列和行引用…因此我尝试列[rowindex]并增加行索引。我不确定如何实现这一点…因为只有“可见的”行是可以访问的。flex datagrid组件不会为数组数据提供程序中的所有行创建视图行,它只创建可见的行。祝您好运!好的-我可以使用datagrid或flex中的任何其他方法实现…基本上我需要动态创建一个10行4列的表-因此需要在ActionScrip中构建tAdrian-看起来我们丢失了一些消息。我需要能够在动态设置中设置变量-某种程度的用户输入/处理。我尝试使用advancedDataGrid,但遇到类似问题。尝试了此rowcontents(已设置为array)=AdvDataGrid.selectedCells({rowIndex:1,columnIndex:1},{rowIndex:1,columnIndex:4})…获取此错误“试图通过静态类型为mx的引用访问不可访问的方法selectedCells。控件:AdvancedDataGrid。”
       <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{employees}">
            <mx:columns>
                <mx:DataGridColumn dataField="Var1" headerText="Var1Name"/>
                <mx:DataGridColumn dataField="Var1" headerText="Var1Name"/>
                <mx:DataGridColumn dataField="Var1" headerText="Var1Name"/>
            </mx:columns>
        </mx:DataGrid>