[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/layouts/vlayout/modules/Inventory/resources/ -> Popup.js (source)

   1  /*+***********************************************************************************
   2   * The contents of this file are subject to the vtiger CRM Public License Version 1.0
   3   * ("License"); You may not use this file except in compliance with the License
   4   * The Original Code is:  vtiger CRM Open Source
   5   * The Initial Developer of the Original Code is vtiger.
   6   * Portions created by vtiger are Copyright (C) vtiger.
   7   * All Rights Reserved.
   8   *************************************************************************************/
   9  
  10  Vtiger_Popup_Js("Inventory_Popup_Js",{},{
  11      
  12      subProductsClickEvent : function() {
  13          var thisInstance = this;
  14          var popupPageContentsContainer = this.getPopupPageContainer();
  15          popupPageContentsContainer.on('click','.subproducts',function(e){
  16              var rowElement = jQuery(e.currentTarget).closest('tr');
  17              e.stopPropagation();
  18              var params = {};
  19              params.view = 'SubProductsPopup';
  20              params.module = app.getModuleName();
  21              params.multi_select = true;
  22              params.subProductsPopup = true;
  23              params.productid = rowElement.data('id');
  24              jQuery('#recordsCount').val('');
  25              jQuery('#pageNumber').val("1");
  26              jQuery('#pageToJump').val('1');
  27              jQuery('#orderBy').val('');
  28              jQuery("#sortOrder").val('');
  29              AppConnector.request(params).then(function(data) {
  30                  jQuery('#popupContentsDiv').html(data);
  31                  jQuery('#totalPageCount').text('');
  32                  thisInstance.registerEventForBackToProductsButtonClick();
  33                  thisInstance.calculatePages().then(function(){
  34                      thisInstance.updatePagination();                    
  35                  });
  36              });
  37          });
  38      },
  39      
  40      /**
  41       * Function to register event for back to products button click
  42       */
  43      registerEventForBackToProductsButtonClick : function(){
  44          jQuery('#backToProducts').on('click',function(){
  45              window.location.reload();
  46          })
  47      },
  48      
  49      /**
  50       * Function to pass params for request
  51       */
  52      getCompleteParams : function(){
  53          var params = this._super();
  54          var subProductsPopup = jQuery('#subProductsPopup').val();
  55          var parentProductId = jQuery('#parentProductId').val();
  56          if((typeof(subProductsPopup) != "undefined") && (typeof(parentProductId) != "undefined")){
  57              params['subProductsPopup'] = subProductsPopup;
  58              params['productid'] = parentProductId;
  59              params['view'] = 'SubProductsPopupAjax';
  60          }
  61          return params;
  62      },
  63      
  64      registerEvents: function(){
  65          this._super();
  66          this.subProductsClickEvent();
  67      }
  68  });
  69  


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1