zoukankan      html  css  js  c++  java
  • flash datagrid嵌入checkbox

    代码如下:

    package
    {
        import fl.controls.CheckBox;
        import fl.controls.listClasses.ICellRenderer;
        import fl.controls.listClasses.ListData;
        import flash.events.Event;
        import fl.core.InvalidationType;
        public class CheckBoxRenderer extends CheckBox implements ICellRenderer
        {
            private var _listData:ListData;
            private var _data:Object;
    
            public function CheckBoxRenderer(){
               super();
               addEventListener(Event.CHANGE, onCheckChange);
            }
            public function set data(d:Object):void{
               _data = d;
               label = "";
               _selected = (_data["checked"]=='true')?true:false;
            }
            public function get data():Object {
               return _data;
            }
            public function get selectedItem():Object {
               return _data;
            }
            public function get listData():ListData {
                return _listData;
            }
            public function set listData(value:ListData):void {
                _listData = value;
            }
            override public function get selected():Boolean {
                return _selected;
             }
           override public function set selected(value:Boolean):void {
           }
            public function onCheckChange(e:Event) {
                 _selected = !_selected;
                _data["checked"] = (_selected==true)?'true':'false';
           }
         }
      }
    
  • 相关阅读:
    [GEF]实现模板功能
    一篇WTP文章
    写代码的代码:JET
    投票选择eclipse.org的新界面
    在SWT里显示AWT对象
    Plugin.xml > Manifest.mf
    关于本体编程的实现
    一个用OWLS组装Web服务的例子
    感受Ruby on Rails
    通过OCP考试
  • 原文地址:https://www.cnblogs.com/wqing/p/2482053.html
Copyright © 2011-2022 走看看