Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何在Meteor的aldeed:表格(DataTables)上显示父/子关系_Jquery_Meteor_Datatable - Fatal编程技术网

Jquery 如何在Meteor的aldeed:表格(DataTables)上显示父/子关系

Jquery 如何在Meteor的aldeed:表格(DataTables)上显示父/子关系,jquery,meteor,datatable,Jquery,Meteor,Datatable,Aldeed:Tablear几乎是数据表的包装器。我要做的是在某些节点上显示父/子关系。 例如,在我的管理面板ORION Cms中,我创建了一个页面->第1页。然后,如果我想为第1页创建一个子页,我想在第1页的正下方显示该子页。请参见此处的示例-> 现在我的数据表显示如下-> 这是这个数据表的代码^ orion.pages.tabular = new Tabular.Table({ name: 'PagesIndex', collection: orion.pages.collection, o

Aldeed:Tablear几乎是数据表的包装器。我要做的是在某些节点上显示父/子关系。 例如,在我的管理面板ORION Cms中,我创建了一个页面->第1页。然后,如果我想为第1页创建一个子页,我想在第1页的正下方显示该子页。请参见此处的示例->

现在我的数据表显示如下->

这是这个数据表的代码^

orion.pages.tabular = new Tabular.Table({
name: 'PagesIndex',
collection: orion.pages.collection,
order: [[0, "desc"]],
columns: [
{ data: 'title', title: i18n('pages.schema.title')},
{ data: 'url', title: i18n('pages.schema.url'), render: function(val,      type, doc) { return '<a href="' + RouterLayer.pathFor('page', doc) + '">' + RouterLayer.pathFor('page', doc) + '</a>'; } },
{ data: 'position', title: 'Order',
    render: function( val, type, doc) {
      return '<input data-id="' + doc._id + '" type="number" value="' + val + '" class="position-input">'
    }
}, 
{ data: 'actions', title: 'Actions',
    render: function (val,type,doc){
      return '<a href="' + Router.path('pages.update', doc) +'" class="btn waves-effect waves-light light-blue accent-4 user-btn-action">Edit</a>'
    },
   tmpl: Meteor.isClient && Template.actionBtns
}
]
});

我没有一个确切的答案给你,但我想你想要一个列表中的列表。这只是一个例子:要做到这一点,您需要在orion.pages.collection中引用您的子页面。一个字段有一个ID数组,例如orion.subPages.collection,您要做的就是找到这些值,并在呈现标题列时将其放入列表中。那将是我的方法。

到目前为止,你尝试了什么?另外,你确定datatables是最好的选择吗?我和创建aldeed:Tablear的人谈过,他告诉我在datatables API中搜索。然而,我发现的一切似乎都过时了。他们有这个唯一的问题是我不确定如何在aldeed:tabular上实现它。是的,但是我如何在列上呈现它?aldeed:Tablear是DataTables的包装器,所以我的问题是如何修改这个包以显示父/子树关系?我的目标是完成这样的事情->我不会使用jstree来处理太多的开销。1.您可以构建另一个名为orion.subPage.collections的集合。。该集合采用{u id:1,name:subPageName,parentPageId:someId,link:http//whatever}2。当您在Tabular.Table内执行呈现调用时,您会执行orion.subPages.collections.find{parentPageId:someId},所有这些都会位于父页面标题下方。因此,我尝试按照您告诉我的做,并且在pages数据表中,没有任何实际更改->。下面是子页面->和页面->的要点,我会尝试这样做:“var arr=subpages.find{parentPageId:this.\u id}.fetch;返回u.eacharr,函数val,字段,数组{val.whatever};嘿,米歇尔,谢谢你的评论。所以我做了你让我做的,这是我的页面屏幕上显示的,我收到一个标题“未定义->这是页面代码的当前要点->