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
Actionscript 3 如何在Flex中处理DataGrid数据提供程序值?_Actionscript 3_Apache Flex_Flex4_Flex3 - Fatal编程技术网

Actionscript 3 如何在Flex中处理DataGrid数据提供程序值?

Actionscript 3 如何在Flex中处理DataGrid数据提供程序值?,actionscript-3,apache-flex,flex4,flex3,Actionscript 3,Apache Flex,Flex4,Flex3,这是我在Flex应用程序中的DataGrid代码,但它给出了错误的输出 <mx:DataGrid id="userListDataGrid" x="60" y="40" width="520" height="148" dataProvider="{schedule}"> <mx:columns> <mx:DataGridColumn dataField="courseDate" headerText="Date"/>

这是我在Flex应用程序中的DataGrid代码,但它给出了错误的输出

<mx:DataGrid id="userListDataGrid" x="60" y="40" width="520" height="148" dataProvider="{schedule}">
    <mx:columns>
        <mx:DataGridColumn dataField="courseDate" headerText="Date"/>               
        <mx:DataGridColumn id="usertype" dataField="userType" headerText="User Type"/>          
        <mx:DataGridColumn id="button1" headerText="Reminder">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:HBox  dataChange="join_changeHandler()">
                             <mx:Script>
                            <![CDATA[
                                import mx.controls.Alert;
                                import valueObjects.CalendarVO;
                                [Bindable]public var labelString:String = null;
                                public var calendar:CalendarVO;
                                protected function join_changeHandler():void
                                {
                                    for each(var cal:Object in outerDocument.schedule)
                                    {
                                        calendar = new CalendarVO();//Hear CalendarVO has Enum in java(HOST,ATTENDEE)only
                                        calendar.userType = cal.userType;
                                        //Alert.show(calendar.userType.toString());
                                        if(calendar.userType.toString() == "HOST")
                                        {
                                            join.visible = true;
                                            start.visible = false;
                                        }
                                        else
                                        {
                                            join.visible = false;
                                            start.visible = true;
                                        }
                                    }

                                }
                            ]]>
                        </mx:Script>
                        <mx:Button id="join" label="Join" borderColor="#5d93b9" color="#04becf">
                        </mx:Button>  
                        <mx:Button id="start" label="Start" borderColor="#5d93b9" color="#04becf"/>

                    </mx:HBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>    
    </mx:columns>
</mx:DataGrid>
最后我想把它弄出来,但我不想。。我想有些事情是…给我建议


最后我得到的结果是我的代码

<mx:DataGrid id="userListDataGrid" x="60" y="40" width="520" height="148" dataProvider="{schedule}">
    <mx:columns>
        <mx:DataGridColumn dataField="courseDate" headerText="Date"/>               
        <mx:DataGridColumn dataField="courseName" headerText="Course Name"/>
        <mx:DataGridColumn id="usertype" dataField="userType" headerText="User Type"/>

        <mx:DataGridColumn headerText="Reminder">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:HBox  dataChange="join_changeHandler()">

                        <mx:Script>
                            <![CDATA[
                                protected function join_changeHandler():void
                                {
                                  if(join.label == 'HOST')
                                        join.label="Start";
                                    else
                                        join.label="Join";
                                }
                            ]]>
                        </mx:Script>
                        <mx:Button id="join" label="{data.userType}" borderColor="#5d93b9" color="#04becf"/>
                    </mx:HBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>

    </mx:columns>
</mx:DataGrid>

<mx:DataGrid id="userListDataGrid" x="60" y="40" width="520" height="148" dataProvider="{schedule}">
    <mx:columns>
        <mx:DataGridColumn dataField="courseDate" headerText="Date"/>               
        <mx:DataGridColumn dataField="courseName" headerText="Course Name"/>
        <mx:DataGridColumn id="usertype" dataField="userType" headerText="User Type"/>

        <mx:DataGridColumn headerText="Reminder">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:HBox  dataChange="join_changeHandler()">

                        <mx:Script>
                            <![CDATA[
                                protected function join_changeHandler():void
                                {
                                  if(join.label == 'HOST')
                                        join.label="Start";
                                    else
                                        join.label="Join";
                                }
                            ]]>
                        </mx:Script>
                        <mx:Button id="join" label="{data.userType}" borderColor="#5d93b9" color="#04becf"/>
                    </mx:HBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>

    </mx:columns>
</mx:DataGrid>