zoukankan      html  css  js  c++  java
  • EXTJS ;pannel 中使用回调函数

    EXTJS   ;pannel 中使用回调函数
     
     
     
     
     
    function checker(val){//返回json数据 “{text:'Ext',url:'http://extjs.com'}
    if(typeof val=='object'){
    return '<a style="display:table;100%;" title="'+val.url+'" target="_blank" href="'+val.url+'">'+val.text+'</a>';
    }
    return "<input type='radio' name='opt_type' value='1' class='ck ckbox_h'/>查询 <input type='radio' name='opt_type' value='0' class='pay ckbox_h'/>充值 <input type='radio' name='opt_type' value='2' class='add ckbox_h'/>添加 <input type='radio' name='opt_type' value='3' class='modi ckbox_h'/>修改 <input type='radio' name='opt_type' value='4' class='del ckbox_h'/>删除";
    }
     
     
    var grid;
    var data;
    var ds = new Ext.data.Store({ //定义本地数据缓存器。
    proxy:new Ext.data.MemoryProxy(parseJson(data)), //代理读取器。
    reader:new Ext.data.ArrayReader({}, //数组读取器 用这个把上边定义好的data通过代理器读进来。
    [
    {name:'id',mapping:0},
    {name:'inter_name',mapping:1},
    {name:'inter_opt_type',mapping:2}
    ])
    });
    ds.load(); //载入数据。
    var sm = new Ext.grid.CheckboxSelectionModel(); //创建一个复选框。
    var colModel = new Ext.grid.ColumnModel([ //创建GridPanel中的列集合。
    new Ext.grid.RowNumberer(), //自动编号。
    sm, //复选框。
    {header:'id',dataIndex:'id',hidden:true}, //这个编号是ds中的创建的id。
    {header:'接口名称',dataIndex:'inter_name',150,align:'center'}, //这个编号是ds中的创建的id。
    {header:'接口类型',dataIndex:'inter_opt_type',50,align:'center'},
    {header:'接口类型',renderer: checker,dataIndex:'inter_opt_type',300,align:'center'}
    ]);
    grid = new Ext.grid.GridPanel({store:ds, //创建GridPanel 并设置store数据。
    cm:colModel, //绑定行。
    sm:sm, //复选框,有了这个可以全选
    635,
    height:400
    //title:'导入文件信息'
    });
  • 相关阅读:
    网站链接
    CSS 初始化
    常见浏览器+浏览器内核
    sublime及其插件的安装
    数码时钟.js
    每天迁移MySQL历史数据到历史库Python脚本
    python和redis简单交互
    python和mongodb简单交互
    python3与mysql交互
    Red Hat Enterprise Linux 7.2修改主机名(hostname)
  • 原文地址:https://www.cnblogs.com/holyes/p/7579ccb93fd624daae78f682a45767f7.html
Copyright © 2011-2022 走看看