<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHeight="600">
    <fx:Declarations>
        <!-- 将非可视元素(例如服务、值对象)放在此处 -->
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            //绑定表格用的数据
            [Bindable]
            private var arr:ArrayCollection = new ArrayCollection([
                {neName:"教工路文一路路口相机_4", neType:"相机" , neAlarmType:"设备告警" , removeStatus:"未清除" , confirmStatus:"未确认" , neAlarmGrade:"2级"},
                {neName:"学院路文一路路口相机_3", neType:"相机" , neAlarmType:"环境告警" , removeStatus:"未清除" , confirmStatus:"未确认" , neAlarmGrade:"3级"},
                {neName:"文一路莫干山路路口相机_1", neType:"相机" , neAlarmType:"连接通信告警" , removeStatus:"未清除" , confirmStatus:"未确认" , neAlarmGrade:"1级"},
                {neName:"文一路莫干山路路口相机_3", neType:"相机" ,  neAlarmType:"性能告警" , removeStatus:"未清除" , confirmStatus:"未确认" , neAlarmGrade:"4级"}
            ]); 

            //删除告警信息
            public function deleteAlarmRecord():void{
                arr.removeItemAt(alarmGrid.selectedIndex);
            }
            //确认告警信息
            public function confirmAlarmInfo():void{
                arr.getItemAt(alarmGrid.selectedIndex).confirmStatus = "已确认";
                alarmGrid.dataProvider = arr;
            }
        ]]>
    </fx:Script>

    <s:DataGrid id="alarmGrid" width="600" height="285" requestedRowCount="4" dataProvider="{arr}">
        <s:columns>
            <s:ArrayList>
                <s:GridColumn dataField="neName" headerText="名称"></s:GridColumn>
                <s:GridColumn dataField="neType" headerText="类型"></s:GridColumn>
                <s:GridColumn dataField="removeStatus" headerText="清除状态"></s:GridColumn>
                <s:GridColumn dataField="confirmStatus" headerText="确认状态"></s:GridColumn>
                <s:GridColumn headerText="操作">
                    <s:itemRenderer>
                        <fx:Component>
                            <s:GridItemRenderer>
                                <s:HGroup>
                                    <mx:LinkButton toolTip="清除" label="清除" click="outerDocument.deleteAlarmRecord();" textDecoration="underline" color="#2066CF" fontWeight="normal"/>
                                    <mx:LinkButton toolTip="确认" label="确认" click="outerDocument.confirmAlarmInfo()" textDecoration="underline" color="#2066CF" fontWeight="normal"/>
                                </s:HGroup>
                            </s:GridItemRenderer>
                        </fx:Component>
                    </s:itemRenderer>
                </s:GridColumn>
            </s:ArrayList>
        </s:columns>
    </s:DataGrid>

</s:Application> 

最新文章

  1. Makefile 使用总结
  2. swift2.2当中的inout参数的使用
  3. AngularJS开发指南16:AngularJS构建大型Web应用详解
  4. LINUX启动ORACLE监听和服务
  5. Cocos2d-x加速度计实例:运动的小球
  6. js 添加enter事件
  7. c - 每位数字尾部加空格
  8. JS截取字符串:slice(),substring()和substr()
  9. 2013长沙网络赛H题Hypersphere (蛋疼的题目 神似邀请赛A题)
  10. Cookie例子
  11. 关于表单提交submit的兼容性问题。
  12. python3 生成器初识 NLP第五条
  13. 继承RelativeLayout 自定义布局
  14. Mysql 关键字的优先级 分组 多表联查
  15. 雷林鹏分享:jQuery EasyUI 数据网格 - 扩展编辑器
  16. Linux内核分析第二周:操作系统是如何工作的
  17. javascript 获取节点元素的封装
  18. day_4_27 py
  19. 洛谷P3676 小清新数据结构题 【树剖 + BIT】
  20. JAVA常见算法题(三十三)---求子串在字符串中出现的次数

热门文章

  1. 【分分钟内搭建一个带用户系统的博客程序(一)用户系统】asp.net core的Identity真香,EF真香!
  2. C# 时间戳与DateTime间的互相转换
  3. sql performance Kill Lock
  4. golang plugin的依赖问题
  5. 总结常见的违背Rest原则的接口设计做法
  6. CF834D The Bakery
  7. WordPress插件Social Warfare&lt;=3.5.2 无需登录RCE漏洞
  8. 如何在linux设置回收站 - 防止失误操作造成数据清空
  9. “全栈2019”Java异常第二十一章:finally不被执行的情况
  10. P5277 【模板】多项式开根(加强版)(bsgs or Cipolla)