zoukankan      html  css  js  c++  java
  • 解决extjs 后台错误不能提示问题

      这两天要解决extjs 控件 Ext.form.field.Text   mastarget:"qtip" 无法显示后台传来的错误

         傻逼了一天,最终发现问题所在:调用了  setActiveErrors([ret.data.ErrorMsg]);是将错误信息加入到布局里面

        但此时是ajax内加入的无法刷新显示,所以必须调用updateLayout();重新更改布局,才能将qtip错误信息显示出来

      (看来在ajax中改变容器内容,是updateLayout()是必不可少的!)以前没关注这个方法,原来如此重要!shit!

      找了良久最关键的原因还是没有 配置 Text的activeErrorsTpl

      ,如果没有配置的话,会自动引用一个“list-box”之类的样式,会把传来的信息给display:"hidden" 隐藏掉,oh!so bad!

         .所以配置activeErrorsTpl 给予一个样式类show(

        .show{  auto;
                height: auto;
                margin: 0 1px;
                color: indianred;
                background-image: url(images/form/exclamation.gif);
                background-repeat: no-repeat;
                list-style: none;

        })

     我们看看 masTarget 几种赋值对text造成的影响:(源自extjs api中)

    If `labelAlign: 'left', `msgTarget: 'side'`
         * 
         *      +----------------------+----------------------+-------------+
         *      | Label:               | InputField           | sideErrorEl |
         *      +----------------------+----------------------+-------------+
         *
         * If `labelAlign: 'left', `msgTarget: 'under'`
         * 
         *      +----------------------+------------------------------------+
         *      | Label:               | InputField      (colspan=2)        |
         *      |                      | underErrorEl                       |
         *      +----------------------+------------------------------------+
         *
         * If `labelAlign: 'top', `msgTarget: 'side'`
         *
         *      +---------------------------------------------+-------------+
         *      | label                                       |             |
         *      | InputField                                  | sideErrorEl |
         *      +---------------------------------------------+-------------+
         *
         * If `labelAlign: 'top', `msgTarget: 'under'`
         * 
         *      +-----------------------------------------------------------+
         *      | label                                                     |
         *      | InputField                      (colspan=2)               |
         *      | underErrorEl                                              |
         *      +-----------------------------------------------------------+
  • 相关阅读:
    简述Javascript中call apply
    tomato固件 路由简单玩 BT 电驴 amule highId python 其实dd wrt也一样 含 amule_2.2.61_mipsel.ipk下载
    Ubuntu10.10 下usb鼠标不动了
    Struts2源码分析 初步1 如何入手以及做了哪些初始化
    ubuntu eclipse easyexplore 替代品 open explorer
    struts2 src study 准备工作 和 略谈 如何读开源代码(Java)
    python 解析XML expat方式
    正则表达式基础 多选结构 加不加括号大不同
    UVa1586,Molar Mass
    UVa12100,Printer Queue
  • 原文地址:https://www.cnblogs.com/shen119/p/3314271.html
Copyright © 2011-2022 走看看