1
저는 Angular Js ui-grid를 만들었고 마지막 열은 버튼으로 구성되어 있습니다. 해당 버튼을 클릭하면 해당 행의 각 셀에 대한 데이터를 가져와야합니다. 누구든지 나를 이해하는 데 도움이된다면 감사하겠습니다. AngularJs - 클릭 한 행의 셀 데이터를 얻는 방법
저는 Angular Js ui-grid를 만들었고 마지막 열은 버튼으로 구성되어 있습니다. 해당 버튼을 클릭하면 해당 행의 각 셀에 대한 데이터를 가져와야합니다. 누구든지 나를 이해하는 데 도움이된다면 감사하겠습니다. AngularJs - 클릭 한 행의 셀 데이터를 얻는 방법
템플릿 기능에 row.entity
추가
var removeTemplate = '<input type="button" value="" style="background: url(../../Content/images/del-currency.png);widht:60px;height:30px" ng-click="removeRow()" />';
$scope.selectedCurrencyGrid = {
data: 'selectedCurrencies',
multiSelect: false,
selectedItems: $scope.selectedCurrencyRow,
enableColumnResize: false,
enableRowSelection: true,
columnDefs: [
{ field: 'Name', displayName: 'Name' },
{
field: 'IsDefault',
displayName: 'Default',
cellTemplate: '<input type="radio" name="radAnswer" ng-model="row.entity.IsDefault">'
},
{ name: 'Photo', field: 'photoP', displayName: '', cellTemplate: removeTemplate }
]
};
$scope.removeRow = function() {
var index = this.row.rowIndex;
//need to get cell data of selected row
};
,
이 있습니다 (행 세포) 개체 속성에 액세스 할 수 있습니다 :
<input type="button" value="" style="background: url(../../Content/images/del currency.png);widht:60px;height:30px" ng-click="removeRow(row.entity)" />';
하는 것은 당신의 기능 확인 conteroller는 매개 변수를 얻습니다.
$scope.removeRow = function (selectedRowObject) {
//Your logic...
};
정확히 내가 원했던 것입니다. soo 많이 고마워요. –
문제 없습니다, 나는 그들의 문서를 보길 권합니다. 그들은 많은 훌륭한 기능을 가지고 있습니다. http://ui-grid.info/docs/#/api – AranS