【问题标题】:Angular ui-grid editDropdownOptionsArray depending on current rowAngular ui-grid editDropdownOptionsArray 取决于当前行
【发布时间】:2016-10-13 14:14:14
【问题描述】:

我想为我的 ui-grid 的每一行设置一个不同的下拉数组。因此我需要访问当前行。我有这样的想法,但我不知道如何访问 columnDefs 中的当前行。有没有简单的方法来实现这一点?

columnDefs: [
    { name: "id", field: "id"},
    { name: "firends", field: "friends", editableCellTemplate: 'ui-grid/dropdownEditor', editDropdownOptionsArray: findFriendsForId(row.id)
]

var findFriendsForId = function(id) {
    // find friends and return them as array
}

【问题讨论】:

  • 我认为你需要的是 ng-model="row.entity.id"

标签: angularjs angular-ui-grid ui-grid


【解决方案1】:

好吧,我自己想通了。有一个函数叫 editDropdownOptionsFunction

Here 就是一个例子。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多