I have grid and custom command
In function of custom command I change $scope variable:
$scope.editLanguage = function (e) {
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
$scope.name = dataItem.Name;
$scope.key = dataItem.Keyword;
$scope.ID = dataItem.ID;
$scope.Image = dataItem.Image;
//$scope.windowEditLanguage.center();
//$scope.windowEditLanguage.open();
}
But It's not work , but if I add some code to handle somethings it's work. but I just want change variale to display imedietly.
$scope.mainGridOptions = { dataSource: { type: "json", transport: { read: "@Url.Action("getLanguage", "DataJson")", }, pageSize: 8, serverPaging: true, serverSorting: true }, columns: [ { template: "<div>" + "<img src='../../Upload/#:data.Image#' style='max-width:100px; max-height:100px;'/>"+ "</div>" , field: "Image", title: "Hình ảnh", width: 200 }, { field: "ID", title: "ID", width: "120px" }, { field: "Name", title: "Tên", width: "120px" }, { field: "Keyword", title: "Từ khóa", width: "120px" }, { command: { text: "Chỉnh sửa", click: $scope.editLanguage }, title: " ", width: "80px" }, { command: { text: "Xóa", click: $scope.deleteLanguage }, title: " ", width: "80px" }, ], editable: "inline", height: 800, scrollable: true, selectable: true };