• 动态加载控件store


    动态加载控件store
     
    控件里面的一部分。
     //构造器
        constructor: function(config){
     
            var flag = this.store == null;
            if(flag){
                this.store = new Ext.data.JsonStore({
                    id: this.ID,
                    autoLoad : false,
                    url: this.baseUrl + "/ListAll",//默认的数据源地址,继承时需要提供
                    baseParams :{type:9},
                    root: "data",
                    totalProperty: "totalCount",
    // remoteSort: true,
                    fields: this.storeMapping
                });
            } 
     
    js页面中使用传值
    create_tem_pay:function(){
            var pay =new TempViewPanel();  //new一个控件
            var paystore = pay.gridPanel.getStore(); //得到 store
            Ext.apply(
                paystore.baseParams,{
                    limit:20,
                    type : 0, 
                    start :0
                });  //重新赋值
            paystore.reload(paystore.baseParams);  //手工加载
            var tem_pay_win;
            if(!tem_pay_win){
                tem_pay_win = new Ext.Window({
                    layout:'fit',
                    650,
                    height:456,
                    collapsible:true,
                    maximizable:true,
                    closeAction:'hide',
                    bodyStyle:'padding:5px;',
                    title: '接口充值类',
                    modal:true,
                    plain: true,
                    items:[pay]
                });
            }
            tem_pay_win.show();
     
    控制器里面的列表
    //列表
        function ListAll()
        {
            /*echo $type = $_POST['type'] ;
              if($type == 1 || $type == 2 || $type == 3 || $type == 4 || $type == 0 || $type == 5 || $type == 6 || $type == 7){
                  $sql = "select * from interface where gameid=-1 and opt_type=".$type ;
              } */
            $sql = "select * from interface where gameid=-1";
            $info = $this->db->query($sql);
            $result = $info->result_array();
            $count=$info->num_rows();
            if($count>0)
            {
                $result = json_encode($result);
                echo '{"totalCount":'.$count.',"data":'.$result.'}' ;
            }
            else
            {
                echo '{"totalCount":'.$count.',"data":[{"id":"0","name":"<font color=red><b>暂无记录</b></font>"}]}' ;
            }
        }
     
     
  • 相关阅读:
    python笔记——调试和异常处理
    [算法学习] 线段树,树状数组,数堆,笛卡尔树
    【cpp】G++中不支持static_cast?
    【生活感想】不够淡定
    数值线性代数小结
    伪逆
    统计机器学习
    Numerical Methods with MATLAB(1)
    吐槽iOS国际化:关于NSLocalizedString的使用
    iOS 沙盒路径操作:新建/删除文件和文件夹
  • 原文地址:https://www.cnblogs.com/holyes/p/7a31a534f52495cd8b233318cea9ce16.html
Copyright © 2020-2023  润新知