Angular UI网格:如何通过第一个UI网格中的按钮使第二个UI网格可见

Angular UI Grid: How do I make a second ui grid visible from a button in the first ui grid?

本文关键字:UI 网格 按钮 第二个 第一个 何通过 Angular      更新时间:2023-09-26

好吧,我制作了这个示例来向大家展示我正在使用的代码。

我正在尝试单击"公司"列下第一个UI网格表中的一个按钮(称为"网格")。单击按钮后,我希望它显示第二个UI网格。

cellTemplate:'<button type="button"  ng-click="hideGrid = !hideGrid">' + 'Grid' + '</button>' }

我认为这条线必须改变,使其与第二个ui网格链接。

如果有人能帮助或引导我朝着正确的方向前进,那将是巨大的帮助。

关闭。这是因为当这样调用时,您的网格无法访问应用程序的作用域。您需要grid.appScope

ng-click="grid.appScope.hideGrid = !grid.appScope.hideGrid"

工作Plunker:http://plnkr.co/edit/ldCnNsqOZCrQs6WtZtOM?p=preview