小编Vah*_*yan的帖子

把手模板 - if语句中的"tilde"

我们有这样的声明:

{{~#if someCondition ~}} 
<div class="whyweneedtildehere"></div> 
{{~/if~}}
Run Code Online (Sandbox Code Playgroud)

简单if语句和if句柄模板中带"〜"的语句有什么区别?

backbone.js handlebars.js marionette

19
推荐指数
2
解决办法
4824
查看次数

Marionette Collection View,获取集合不会触发事件

我有一个问题:我CollectionView没有渲染我的ItemViews.我将一个集合从布局传递到集合视图.我正在收集以下内容CollectionView:

在布局中:

    // Create a a collection for the view
    this.articles = new Articles(null, {
        organizationId : this.model.organizationId,
        projectId : this.model.id
    });

    var articlesView = new ArticleCollectionView({ collection : this.articles});
    this.articlesRegion.show(articlesView);
Run Code Online (Sandbox Code Playgroud)

在CollectionView中:

define([
    'marionette',
    'templates',
    'i18n!nls/projectDashboard',
    'views/projectDashboard/ArticleItem'
], function (Marionette, templates, msg, ArticleItemView) {

    return Marionette.CollectionView.extend({

        initialize : function () {
            this.listenTo(this.collection, "reset", this.render);
            this.collection.fetch();
        },

        itemView : ArticleItemView

    });

});
Run Code Online (Sandbox Code Playgroud)

在ItemView中:

define([
    'marionette',
    'templates',
    'models/Article'
],
function (Marionette, templates, Article) {

    return Marionette.ItemView.extend({ …
Run Code Online (Sandbox Code Playgroud)

javascript collections view backbone.js marionette

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

Rails axlsx_rails 宝石。在现有行之间插入新行

我正在使用基于 的 gem生成.xlsx文件。我接收行作为数组并像这样绘制它们:axlsx_railsaxlsx

# Workbook, sheet and styles creations left... 
data["config"].each do |item|
    sheet.add_row item.each_with_index.map{|row, index| row["value"]}, :style => row_style       
end
Run Code Online (Sandbox Code Playgroud)

然后我需要在第二行和第三行之间插入一个新行。我想知道我怎样才能实现这一目标?

ruby ruby-on-rails spreadsheet axlsx

4
推荐指数
1
解决办法
2900
查看次数

axlsx_rails。一次设置多行的高度

我正在*.xlsx使用axlsx_rails基于xlsx gem生成文件。

我正在为这样的单行设置高度:

sheet.add_row [1,2,3,4,5,6], :style => 预定义样式, :height => 14.3

如何为一批行设置高度,如果可能,哪个声明具有更高的优先级?

ruby ruby-on-rails xlsx axlsx

2
推荐指数
1
解决办法
2493
查看次数