gpt4 book ai didi

angularjs - ngGrid 双击行打开弹出窗口以编辑行

转载 作者:行者123 更新时间:2023-12-02 23:46:33 25 4
gpt4 key购买 nike

我将如何在 ng-Grid 中实现双击事件?更具体地说,我希望双击打开弹出模式(Angular UI Modal)进行编辑。

关于如何做到这一点有什么想法吗?

最佳答案

在 ng-grid 2.0.11 中,只需调用行模板中的 ng-dblclick 指令

$scope.gridOptions = {
data: 'gdDtA',
rowTemplate: '<div ng-dblclick="foo(row)" ng-style="{\'cursor\': row.cursor, \'z-index\': col.zIndex() }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell {{col.cellClass}}" ng-cell></div>',
};

$scope.foo = function(r) {
console.log(r);
}

参见:https://github.com/angular-ui/ng-grid/wiki/Templating

关于angularjs - ngGrid 双击行打开弹出窗口以编辑行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20133550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com