Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. <table data-ng-repeat="SupplierModels in Supplierlist | filter:suppliersearch">
  2. <tr>
  3. <td class="roundedCorners6_account" ng-class='{roundedCorners6_account_active: $index==selectedRowslist}' style="width: 200px; cursor: pointer; text-align: center;">
  4. <div ng-click="showSupplier(SupplierModels.supplier_ID, $index)">{{SupplierModels.supplier_Name | truncate}}</div>
  5. </td>
  6. </tr>
  7. </table>
  8.  
  9. function initialLoading() {
  10. ServiceFactory.Invoke(baseurl + 'Api/SupplierApi/SupplierList').success(function (success) {
  11. $scope.Supplierlist = success;
  12. }).error(function (error) {
  13. alert(error);
  14. })
  15. }
  16.  
  17. $scope.SaveSupplier = function () {
  18. $scope.IsValidatesupplierData($scope);
  19. if ($rootScope.alerts.length == 0) {
  20. ServiceFactory.InvokeWithParameters(baseurl + 'Api/SupplierApi/SaveSupplier', $scope.supplier).success(function (success) {
  21. initialLoading();
  22. var rows = $scope.selectedRowslist == undefined ? $scope.Supplierlist.length : $scope.selectedRowslist;
  23. var supId = success;
  24. $scope.showSupplier(supId, rows);
  25. $scope.visible = true;
  26. }).error(function (error) {
  27. alert(error);
  28. })
  29. }
  30. else {
  31. $rootScope.isErrorPopUpShow = true;
  32. }
  33. }
  34.  
  35. $scope.showSupplier = function (id, rows) {
  36. $scope.visible = true;
  37. ServiceFactory.InvokeWithParameters(baseurl + 'Api/SupplierApi/SupplierDetail?supplierId=' + id).success(function (success) {
  38. $scope.supplier = success;
  39. $scope.selectedRowslist = rows;
  40. }).error(function (error) {
  41. alert(error);
  42. })
  43. }
  44.  
  45. <td class="roundedCorners6_account"
  46. ng-class='{roundedCorners6_account_active: activeSupplierID== SupplierModels.supplier_ID}'
  47.  
  48. $scope.showSupplier = function (id, rows) {
  49. $scope.visible = true;
  50. ServiceFactory.InvokeWithParameters(baseurl + 'Api/SupplierApi/SupplierDetail?supplierId=' + id).success(function (success) {
  51. $scope.supplier = success;
  52. $scope.activeSupplierID = id; //supplier.id ? if it exists.
  53. ...
  54. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement