Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table data-ng-repeat="SupplierModels in Supplierlist | filter:suppliersearch">
- <tr>
- <td class="roundedCorners6_account" ng-class='{roundedCorners6_account_active: $index==selectedRowslist}' style="width: 200px; cursor: pointer; text-align: center;">
- <div ng-click="showSupplier(SupplierModels.supplier_ID, $index)">{{SupplierModels.supplier_Name | truncate}}</div>
- </td>
- </tr>
- </table>
- function initialLoading() {
- ServiceFactory.Invoke(baseurl + 'Api/SupplierApi/SupplierList').success(function (success) {
- $scope.Supplierlist = success;
- }).error(function (error) {
- alert(error);
- })
- }
- $scope.SaveSupplier = function () {
- $scope.IsValidatesupplierData($scope);
- if ($rootScope.alerts.length == 0) {
- ServiceFactory.InvokeWithParameters(baseurl + 'Api/SupplierApi/SaveSupplier', $scope.supplier).success(function (success) {
- initialLoading();
- var rows = $scope.selectedRowslist == undefined ? $scope.Supplierlist.length : $scope.selectedRowslist;
- var supId = success;
- $scope.showSupplier(supId, rows);
- $scope.visible = true;
- }).error(function (error) {
- alert(error);
- })
- }
- else {
- $rootScope.isErrorPopUpShow = true;
- }
- }
- $scope.showSupplier = function (id, rows) {
- $scope.visible = true;
- ServiceFactory.InvokeWithParameters(baseurl + 'Api/SupplierApi/SupplierDetail?supplierId=' + id).success(function (success) {
- $scope.supplier = success;
- $scope.selectedRowslist = rows;
- }).error(function (error) {
- alert(error);
- })
- }
- <td class="roundedCorners6_account"
- ng-class='{roundedCorners6_account_active: activeSupplierID== SupplierModels.supplier_ID}'
- $scope.showSupplier = function (id, rows) {
- $scope.visible = true;
- ServiceFactory.InvokeWithParameters(baseurl + 'Api/SupplierApi/SupplierDetail?supplierId=' + id).success(function (success) {
- $scope.supplier = success;
- $scope.activeSupplierID = id; //supplier.id ? if it exists.
- ...
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement