`
hellodajun
  • 浏览: 63928 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Ext DataView tpl

 
阅读更多
  var tpl = new Ext.XTemplate
   (
   '<tpl for=".">',
     '<div class="view-item" >',
      '<table width="100%">',
       '<tr>',
        '<td width="16" class="{[this.getTxtStyle(values)]}">{#}</td>',
        '<td width="16" class="{[this.getTxtStyle(values)]}">',
         '<tpl if=" ATTACHMENT!=null ">',
          '<img src="../images/ico-attch.gif" width=16 height=16/>',
         '</tpl>',
        '</td>',
        '<td width="16" class="{[this.getTxtStyle(values)]}">',
         '<tpl if=" FEEDBACKSTATUS==1">',
          '<img src="../images/taskplan/task_lvl_2.gif" width=16 height=16/>',
         '</tpl>',
         '<tpl if=" FEEDBACKSTATUS==2">',
          '<img src="../images/taskplan/task_lvl_3.gif" width=16 height=16/>',
         '</tpl>',
         '<tpl if=" FEEDBACKSTATUS==3">',
          '<img src="../images/taskplan/task_lvl_1.gif" width=16 height=16/>',
         '</tpl>',
         '<tpl if=" FEEDBACKSTATUS==4">',
          '<img src="../images/taskplan/task_lvl_4.gif" width=16 height=16/>',
         '</tpl>',
         '<tpl if=" FEEDBACKSTATUS==5">',
          '<img src="../images/ico-light-red.gif" width=16 height=16/>',
         '</tpl>',
        '</td>',
        '<td  class="{[this.getTxtStyle(values)]}">{FEEDBACKUSER}</td>',
        '<td width="150" class="txt">{time}</td>',
       '</tr>',
      '</table>',
     '</div>',
   '</tpl>',
   '<div class="x-clear"></div>',
   {
    isRead : function(values)
    {
     return '<img src="/images/communication/feedback_isread_'
      + values.ISREAD +
      '.png" width=16 height=16/>';
    }
   },
   { 
               getTxtStyle : function (values)
               { 
              if(values.OVERTIME == "超期" )
               { 
      return 'redtxt'; 
                 }
                 else
                 {
      return 'txt'; 
                 }         
               } 
           }
  );
  this.dataView = new Ext.DataView
  ({
   cls : 'oa-dataview',
   style : 'overflow:auto',
    tpl : tpl,
    itemSelector : 'div.view-item',
    store : this.store,
    multiSelect : false,
    singleSelect : true,
    overClass : 'view-over',
    selectedClass : 'view-selected',
    deferEmptyText : '暂无',
    prepareData : function(data,num,record)
    {
     data.time = Ext.util.Format.javaDate(data.FEEDBACKTIME,'Y-m-d H:i');
     return data;
    }
  });
分享到:
评论
1 楼 目步 2012-02-14  

相关推荐

    Ext.DataView 图片列表显示

    var dataview = new Ext.DataView({ store: store, tpl : tpl, id: 'phones', itemSelector: 'li.phone', overClass : 'phone-hover', singleSelect: true, multiSelect : false, autoScroll : true }); ...

    EXT2.0分页

    实现EXT2.0分页的关键组件是DataView和Store。DataView是一个可配置的组件,用于显示数据集中的项,它可以与Store进行联动,当Store中的数据发生变化时,DataView会自动更新。Store则负责管理和操作数据,包括加载、...

    Ext 将grid渲染到combox

    此外,需要注意的是 `ComboBox` 的下拉菜单实际上是通过 `DataView` 来生成的,而 `DataView` 的渲染对象是 `this.innerList`,这表明 `ComboBox` 内部有一个用于存放下拉菜单内容的容器。因此,即使使用了自定义的 ...

    AnyFo_-_ExtJS_移魂大法

    var tpl = new Ext.XTemplate( '&lt;ul&gt;', '&lt;tpl for="."&gt;', '&lt;li&gt;{name}&lt;/li&gt;', '&lt;/tpl&gt;', '&lt;/ul&gt;' ); var data = [ { name: 'Item 1' }, { name: 'Item 2' }, { name: 'Item 3' } ]; var div = ...

    用extjs 4.0打造自己的WEB桌面

    tpl: new Ext.XTemplate(a.shortcutTpl), listeners: { resize: this.initShortcut } } } ``` 测试和优化 为了测试我们的桌面应用程序,我们可以在 App.js 文件的 getDesktopConfig 函数中,通过复制增加图标...

    解决extjs 桌面图标换行方法

    tpl: new Ext.XTemplate(me.shortcutTpl), listeners: { resize: me.initShortcut } }; } ``` ##### 3. 调用`initShortcut`函数 最后,在`afterRender`函数中调用了`initShortcut`函数,以确保在页面初次加载...

Global site tag (gtag.js) - Google Analytics