做项目周报 心得

本文介绍如何使用 ExtJS 实现组件的功能定制与数据绑定,包括获取焦点、下拉框配置、数据渲染及监听事件等操作。通过具体示例展示了如何设置下拉框的数据源、渲染方式以及响应事件。

简单的获取焦点

focus:function(th){

           th.focus(true);

                        }

鼠标移上去  显示所有

renderer:function(v){
                    if(v != null && v!="")
                        return "<span title='"+v+"'>"+v+"%"+"</span>";
                }

清除上次修改记录

pruneModifiedRecords : true,


组合下拉框

    store : new Ext.data.SimpleStore( {
            fields : [ 'value', 'text' ],
            data : [ [ '0', '待安排' ], [ '1', '已安排' ]]
        }),

------简单的下拉框
            id: 'classify',
          header: '分类',
          dataIndex: 'classify',
          width: 200,
          renderer:function(v){
              return getDecode(v,null,"",["0","其它","1","研发","2","采购","3","市场支持"]);
          },
          editor:new fm.ComboBox({
              store : new Ext.data.ArrayStore({
                  data:[["0","其它"],["1","研发"],["2","采购"],["3","市场支持"]],
                  fields:["value","text"]
              }),
              mode : "local",
              triggerAction : "all",
              displayField : "text",//选择的时候显示的值
              valueField : "value"//最终显示的数据 然后经过renderer渲染
          })
     ------------

listeners:{
                              select:function(cmb,record,index){
                                  Ext.getCmp("todaywork").getStore().getAt(selectRowIndex).set("account",record.data["value"]);
                                  Ext.getCmp("todaywork").getStore().getAt(selectRowIndex).set("principal",record.data["username"]);
                                  if(Ext.getCmp("todaywork").getStore().getAt(selectRowIndex).get("deptname")==null ||
                                          Ext.getCmp("todaywork").getStore().getAt(selectRowIndex).get("deptname") == ""){
                                      Ext.getCmp("todaywork").getStore().getAt(selectRowIndex).set("deptname",record.data["deptname"]);
                                      Ext.getCmp("todaywork").getStore().getAt(selectRowIndex).set("depten",record.data["depten"]);
                                  }
                              },
                              focus:function(th){
                                  th.focus(true);
                              }
                          }

-----------------------


            Map<String, Object> map = new HashMap<String, Object>();
            Object[] obj = (Object[]) list.get(i);
            map.put("id", obj[0]==null ? "" : obj[0].toString());

--------------

 <comment>标准批量任务表</comment>
        <id name="funcid" type="java.lang.Long">
            <column name="FUNCID" precision="10" scale="0" />
                <generator class="sequence">
                <param name="sequence">PMS_PRJ_SCOPE_SEQ</param>
            </generator>
        
        </id>

-------------------

一个数据 传递两次 就会自动转成数组


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值