|
|
1
1
在gridOptions对象所在的控制器或服务中,访问gridApi而不使用$scope的方法是确保添加以下属性:appScopeProvider:它允许您设置此对象的名称,我的示例是$ctrl。和onRegisterApi:这是允许您访问gridApi所必需的。参考 http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions 当您使用appScopeProvider重置this对象的名称时,您也在设置gridApi的名称。因此,在中,而不是使用$ctrl。gridapi您只需要单独使用$ctrl。因此,在我的案例中,解决方案如下:
我还必须将函数paginationChanged()中的参数$scope设置为null,因为我不想使用$scope。 |
|
|
2
0
gridApi对象不会自动添加到$ctrl。如果你想把它放在那里,你必须自己把它贴上。 以下是如何通过onRegisterApi回调访问gridApi:
|
|
|
lazerbrain · 如何取消角度ui网格中的单元格编辑? 8 年前 |
|
|
Anouar Ghali · 如何使用力矩。带ui的js。网格 8 年前 |
|
|
Aric Peters · 从angular ui网格更新数据库 8 年前 |
|
|
Sahil · 使用UI grid celltemplate添加图标 8 年前 |
|
|
FullStackDeveloper · 如何在网格标题中隐藏排序号 8 年前 |