我想将单元格模板化为下拉按钮.所以我创建了一个单元格模板,其中的按钮链接到下拉指令.如果我在网格外创建这个按钮,它正在工作,但在网格内部则不然.我不确定,但我想$scope模板中无法访问.
我创建了一个显示问题的Plunker
我正在使用AngularUI-Grid的ng-grid,并有一个行选择复选框.它也在标题中给了我一个复选框.
如果用户在标题中选中复选框,我希望在$ scope中触发一些事件/方法,有什么办法吗?我想通过指定: - checkboxHeaderTemplate,我会调用toggleSelectAll()方法.但它没有发生.任何线索?还有任何$ scope的事件或方法,可以在多行选择或取消选择时调用.
$scope.gridOptions = {
data: 'dataList',
enablePaging: true,
showFooter: true,
showFilter: true,
totalServerItems: 'totalVehicles',
pagingOptions: $scope.VehpagingOptions,
filterOptions: $scope.VehfilterOptions.filterText,
showSelectionCheckbox: true,
beforeSelectionChange: $scope.beforeVehicleSelectionChange,
checkboxHeaderTemplate: '<input class="ngSelectionHeader" type="checkbox" ng-show="multiSelect" ng-model="allSelected" ng-change="toggleSelectAll(allSelected, true)"/>'
};
Run Code Online (Sandbox Code Playgroud) 我在ui.bootstrap手风琴中使用ng-Grid时遇到了问题.看看我的Plunker,看看问题在于什么.
基本上,当在初始页面加载时关闭子手风琴组的手风琴中放置网格时,网格的宽度为零并且不显示.
任何人都可以通过调整CSS类或捕获手风琴组事件并重新渲染网格来指明我解决这个问题的方向吗?我一直在用这个圈子跑来跑去!
编辑:道歉,普兰克现在公开!
我正在探索Angular.js UI-Grid.但是,当我在我的服务中发出HTTP请求时,我似乎无法弄清楚为什么数据未定义.当我从控制器发出HTTP请求时似乎工作正常.如何使Ui-Grid以模块化方式工作?
HTML
<div id="grid1" ui-grid="gridOptions" class="grid"></div>
Run Code Online (Sandbox Code Playgroud)
调节器
app.controller('tableCtrl', function($scope, tableService) {
var getAllArtistData = function() {
tableService.getArtistData().then(function(data) {
console.log("this is controller data", data);
$scope.gridOptions.data = data;
$scope.gridOptions = {};
$scope.gridOptions.columnDefs = [
{name:'artist_id'},
{name:'first_name'}
];
});
};
getAllArtistData();
});
Run Code Online (Sandbox Code Playgroud)
服务
app.service('tableService', function($http, $q) {
/************************************************
GET ARTIST DATA
************************************************/
this.getArtistData = function() {
var defer = $q.defer();
$http.get('../../../data/artists-lite.json')
.success(function(response) {
console.log("this is response", response);
defer.resolve(response);
})
.error(function(err) {
defer.reject(err);
});
return defer.promise;
};
});
Run Code Online (Sandbox Code Playgroud)
App.js
'use strict';
var app …Run Code Online (Sandbox Code Playgroud) 单击"添加行"按钮时,它在ui-grid顶部添加了一个新行,其焦点为第一列.按Tab键后,它不会转到同一行的Next Column,而是转到下一行列.
http://plnkr.co/edit/VYhhIpdUAUzoXr2RiYKG?p=preview Here is my code in [plnkr]
请咨询.
我正在尝试为角度 ui-grid 制作一个下拉过滤器。我最初在这里找到了操作方法文章,在无法使用它时,我回到源头尝试使用它。我仍然没有成功。列过滤器看起来像一个普通过滤器,没有任何下拉菜单。有人可以帮我解决吗?
列定义:
{
field: 'sex'
, displayName: 'SEX'
, width: '120'
, type: uiGridConstants.filter.SELECT
, filter: { selectOptions: [ { value: 'male', label: 'male' }, { value: 'female', label: 'female' } ] }
}
Run Code Online (Sandbox Code Playgroud)
这是它的外观(如果我点击输入,它只接受文本)
我还缺少其他东西吗?
-----更新我的整个设置-----
//options for the main grid
$scope.gridOptions = {
enableFiltering: true,
multiSelect: false,
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi; //so we can use gridapi functions of ui-grid
//handler for clicking rows and getting row object
gridApi.selection.on.rowSelectionChanged($scope, function(row){
thisRow = …Run Code Online (Sandbox Code Playgroud)