解决方案 »

  1.   

    {header:'支撑文件',dataIndex:'supportfile',width:60,renderer:renderSupportFile}
    看这里
    这样写
    {header:'支撑文件',dataIndex:'supportfile',width:60,renderer:renderSupportFile,handler:function(){
       alert('123456');
    }}
      

  2.   

    function renderSupportFile(projectid) {
            var str = "<input type='button' value='查看' onclick='javascript:showTest() ' />";
            return str;
    }
    你这里的onclick就不要了
      

  3.   

    让你看看我的代码:
    /**
     * ClassName 人员数据列表视图
     * */
    Ext.define("nac.system.view.DataBackUpGrid", {
    extend : "Ext.grid.Panel",
    alias : "widget.DataBackUpGrid",
    id:'DataBackUpGrid',
    region:'center',
    store : 'nac.system.store.DataBackUpStore',
    border : 0,
    height:"100%",
    width:"100%",
    multiSelect : true,
    frame : true,
    tbar:[
    {xtype:'button',text:'立即备份',ref:'backup',tooltip:'立即备份',iconCls:'hupu_manual'},
    {xtype:'button',text:'自动备份',ref:'auto_rec',tooltip:'自动备份',iconCls:'hupu_autobackup'},
    {xtype:'button',text:'自动清理',ref:'auto_del',tooltip:'自动清理',iconCls:'hupu_autoclear'}
    ],
    listeners:{
    'beforerender':function(self,opts){
    self.getStore().load();
    }
    },
    sortableColumns:false,
    enableKeyNav : true, //可以使用键盘控制上下
    columnLines : false, //展示竖线
    columns:[{
    header:'备份文件',
    flex:1,
    dataIndex:'fileName'
    },{
    header:'备份日期',
    flex:0.8,
    dataIndex:'fileDate',
    renderer: function(value,metaData,record,colIndex,store,view) {
    value = Ext.util.Format.date(value,'Y-m-d H:i:s');
            return (value==null||value=="")?"--":value;
            }
    },{
    header:'文件大小',
    flex:.8,
    dataIndex:'fileSize'
    },{
    xtype:'actioncolumn',
    header:'操作',
            width:100,
            id:'DataBackUpDeal',
            items: [{
                icon: 'nacCore/nacCoreApp/nacApp/images/mainmenu/db_restore.png', 
                tooltip: '还原',
                iconCls: 'hupu_cursor' 
            },{
             iconCls : 'hupu_space', 
                tooltip: ''
            },{
                icon: 'nacCore/nacCoreApp/nacApp/images/mainmenu/db_remove.png',
                tooltip: '删除',
                iconCls: 'hupu_cursor'
            }]
    }]
    });
      

  4.   


    icon: 'nacCore/nacCoreApp/nacApp/images/mainmenu/db_remove.png',
    tooltip: '删除',
    iconCls: 'hupu_cursor',
    handler:function{
              alert('123456');
    }
      

  5.   

    你这种写法看起来不像是纯正的ExtJS啊,哈哈,你不就是需要一个button么,楼上的可以参考
      

  6.   

    //点击“查看”按钮后,弹出窗口
    function showTest() {
    alert(123);
    }这个函数是不是在ready里面写着呢?放到最外面试试。而如果改用onclick='alert(“+projectid+”) '却能正常执行
    肯定是作用域的问题
      

  7.   

            renderer: function(v){
        v = (Math.round((v-0)*100))/100;
    v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);
    return v + "%";
    }
    这样写对我有帮助啊。赞一个
      

  8.   

    Quote: 引用 8 楼 zebro1573 的回复:
    [/qu ote]