小编pmd*_*row的帖子

使用ng-grid的列菜单的z-index问题

当我在同一页面上放置两个ng-grid并打开第一个网格的colum菜单时,第二个网格的标题将重叠,如此屏幕截图所示:

ng-grid截图

我已经尝试将z-index列菜单设置为非常高的值,但它没有任何效果.我尝试了其他几种方法,但我显然遗漏了一些东西.有什么建议?Plunker展示了这里的行为:

http://plnkr.co/edit/Eb3BL0l01GHXLvVSGTA5

html5 z-index css3 angularjs ng-grid

7
推荐指数
1
解决办法
2269
查看次数

使用nose捕获subprocess.Popen()的输出

我正在使用nose来测试subprocess.Popen()用于调用脚本的应用程序.捕获logcapture插件似乎都不捕获此脚本的输出.是否有一种简单的方法将此输出传输到鼻子?

这是我到目前为止所做的尝试; 注意未捕获"捕获我":

example.py:

if __name__ == '__main__':
    print 'Capture me'
Run Code Online (Sandbox Code Playgroud)

test.py:

import subprocess
import sys


def test_popen():
    # nose's capture plugin replaces sys.stdout with a StringIO instance.
    # subprocess.Popen() expects stdout to have a fileno property, which
    # StringIO doesn't, so fake it.
    sys.stdout.fileno = lambda: 1

    subprocess.Popen(['python', 'example.py'], stdout=sys.stdout)
    assert False # Force test to fail so we see nose output
Run Code Online (Sandbox Code Playgroud)

输出:

$ nosetests test.py …
Run Code Online (Sandbox Code Playgroud)

python nose nosetests

7
推荐指数
1
解决办法
1011
查看次数

在不破坏绑定的情况下迭代两个数组

我有一个组件接受一个值数组和相同长度的数组,每个值都有一个验证错误字符串.我想显示一个表单字段列表,其中包含每个值和错误对的输入.我试过像这样创建一个计算属性:

var myComponent = Ember.Component.extend({
  //values: <provided array of input values>
  //errors: <provided array of error strings>
  valuesAndErrors: function() {
    var combined = [];
    for (var i = 0; i < values.length; i++) {
      combined.pushObject({
        value: this.get('values')[i],
        error: this.get('errors')[i]
      });
    }
    return combined;
  }.property('values.@each', 'errors.@each')
});
Run Code Online (Sandbox Code Playgroud)

但不幸的是,对valuesAndErrors(例如via {{input value=valuesAndErrors.value}})中的值所做的更改不会被推回源values数组.在不破坏这样的绑定的情况下values,errors同时迭代和数组的正确方法是什么?

我目前正在使用Ember 1.9.

ember.js

5
推荐指数
1
解决办法
663
查看次数

标签 统计

angularjs ×1

css3 ×1

ember.js ×1

html5 ×1

ng-grid ×1

nose ×1

nosetests ×1

python ×1

z-index ×1