0
我正在使用此鏈接創建一個簡單演示 http://ui-grid.info/docs/#/tutorial/101_intro。 我可以獲得點擊事件(請點擊第一列編輯圖片)。它顯示一個模式。我點擊圖片打開模式。它顯示預填所選項目的條目。我也能夠獲得模型中存在的點擊按鈕(保存並取消),但是我想要這樣:如果用戶在輸入欄中更改第一個和第二個,當用戶按下保存按鈕。如何在角度保存表中的條目?
這裏是我的代碼: http://plnkr.co/edit/PLy6rSUIOMoVO6iKfPOY?p=preview
.controller('ModalInstanceCtrl', function ($scope, $uibModalInstance, row, grid) {
var vm=this;
console.log(row);
vm.first=row.entity.name;
vm.second=row.entity.lastname;
vm.save = function() {
alert('save')
};
vm.cancel = function() {
$uibModalInstance.dismiss('cancel');
};
});