xiaoliaolcy 2009-05-04 12:08
浏览 233
已采纳

ext菜单显示问题

我把一个表单 score_ploy_create_form,通过
new Ext.menu.Adapter(score_ploy_create_form,{hideOnClick:false}) 转换成一个成菜单项,但是表单里面的下拉列表日期无法选择值,如果把表单加入到window里面的话显示都是正确的,请问这个是这么回事?
[b]问题补充:[/b]
[url]http://www.beppon.com/welcome.shtml[/url] 这上面的例子中的"高级查询"就实现了这样的功能了的,不知道他是怎么实现?
[b]问题补充:[/b]
你是怎么看出来的? 还有window的显示位置怎么控制?
[b]问题补充:[/b]
请问哈,如果重写grid的单击事件,
在我的应用程序中,我想所有grid单击单元格的时候都复制单元格的内容.如果不重写grid的单击事件的话.应用中的所有grid的单击事件都要去重新定义. grid.on('rowclick',copy);
请问哈如何重写?
[b]问题补充:[/b]
给个例子嘛, 比如我重写的rowclick他会自动调用?

  • 写回答

4条回答 默认 最新

  • zhoujuan520 2009-05-05 12:36
    关注

    我用你的代码做了一个,发现下拉的左边会有一个竖条,就是存放菜单图标的那个竖槽!

    而他的没有,所以可以看出来他不是通过Ext.munu.Adapter来实现的.

    至于怎么控制位置这个就简单了.

    我推算出来他的实现方法.我给个思路

    一.
    首先点击按钮的时候 创建窗体,窗体的配置属性里面可以设置初始坐标 x,y

    [code="js"]
    x : Number
    The X position of the left edge of the Window on initial showing. Defaults to centering the Window within the width of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).

    y : Number
    The Y position of the top edge of the Window on initial showing. Defaults to centering the Window within the height of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).
    [/code]

    让这个弹出来的窗体的初始y加上当前按钮的高度也就是20像素的样子,x就等于按钮的x坐标就可以了.至于怎么获得按钮的坐标,你可以参考api
    所有的组建都有这个方法来获得当前组件的xy坐标
    [code="js"]
    getPosition( [Boolean local] ) : Array
    Gets the current XY position of the component's underlying element.
    Parameters:
    local : Boolean
    (optional) If true the element's left and top are returned instead of page XY (defaults to false)
    Returns:
    Array
    The XY position of the element (e.g., [100, 200])
    [/code]

    二.
    你可以查下Element的api,他有这么一个方法.怎么用你看了就明白了
    [code="js"]
    alignTo( Mixed element, String position, [Array offsets], [Boolean/Object animate] ) : Ext.Element
    Aligns this element with another element relative to the specified anchor points. If the other element is the document it aligns it to the viewport. The position parameter is optional, and can be specified in any one of the following formats:
    Blank: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").
    One anchor (deprecated): The passed anchor position is used as the target element's anchor point. The element being aligned will position its top-left corner (tl) to that point. This method has been deprecated in favor of the newer two anchor syntax below.
    Two anchors: If two values from the table below are passed separated by a dash, the first value is used as the element's anchor point, and the second value is used as the target's anchor point.
    In addition to the anchor points, the position parameter also supports the "?" character. If "?" is passed at the end of the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to the viewport if necessary. Note that the element being aligned might be swapped to align to a different position than that specified in order to enforce the viewport constraints. Following are all of the supported anchor positions:
    Value Description


    tl The top left corner (default)
    t The center of the top edge
    tr The top right corner
    l The center of the left edge
    c In the center of the element
    r The center of the right edge
    bl The bottom left corner
    b The center of the bottom edge
    br The bottom right corner
    Example Usage:
    // align el to other-el using the default positioning ("tl-bl", non-constrained)
    el.alignTo("other-el");

    // align the top left corner of el with the top right corner of other-el (constrained to viewport)
    el.alignTo("other-el", "tr?");

    // align the bottom right corner of el with the center left edge of other-el
    el.alignTo("other-el", "br-l?");

    // align the center of el with the bottom left corner of other-el and
    // adjust the x position by -6 pixels (and the y position by 0)
    el.alignTo("other-el", "c-bl", [-6, 0]);
    Parameters:
    element : Mixed
    The element to align to.
    position : String
    The position to align to.
    offsets : Array
    (optional) Offset the positioning by [x, y]
    animate : Boolean/Object
    (optional) true for the default animation or a standard Element animation config object
    Returns:
    Ext.Element
    this
    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器