• 【编程技巧】ExtJs 设置GridPanel表格文本垂直居中


    详细讲解见 http://blog.csdn.net/li396864285/article/details/9310983

     以下是我改修的代码:

    {
             90,
             items:[{
              75,
              xtype:"button",
              iconCls:"btn-list",
              text:"查询",
              handler:function(){
               store.load({
                   params: {start:0, limit: 15}
                  });
               store.on('load',setTdCls);           
              }
             }]
      },

    function setTdCls(){ 
         var gridJglb=document.getElementById("ext-comp-1026"); 
                     var tables = gridJglb.getElementsByTagName("table"); 
                      for(var k = 0; k < tables.length; k++){ 
                         var tableV=tables[k]; 
                        if(tableV.className=="x-grid3-row-table"){ 
                              var trs=tables[k].getElementsByTagName("tr"); //找到每个tr
                             for(var i = 0;i < trs.length;i++){ 
                                  var tds=trs[i].getElementsByTagName("td"); //找到每个td
                                  
                                  var tdd=tds[0].getElementsByTagName("div");//找到每个div
                                  tdd[0].style.marginTop="10px";   //设置居中无效,用marginTop代替
                                  
                              } 
                         }; 
                      } 
                  } 

  • 相关阅读:
    oracle11g2下载安装笔记
    eclipse的下载安装配置
    实现图片的缩放 添加鼠标滑轮事件
    MySQL5.7.21非图形化下载、安装、连接问题记录
    python学习登录接口
    python学习计算器
    python学习简单购物商城的实现
    python学习三级菜单
    ios学习之UISwipeGestureRecognizer手势识别
    ”isEqual“ ”isEqalToString“ 和“==”三者区别
  • 原文地址:https://www.cnblogs.com/ejllen/p/3232234.html
Copyright © 2020-2023  润新知