Hallo,
ich versuche innerhalb eines Plugins eine weitere Instanz aufzurufen. Dabei sollen die Optionen der übergeordneten übernommen und this für die aufgerufene Instanz gelten. Geht das? Hat jemand einen Tipp?

Hier ein auszug des codes

PHP-Code:
globals: function(that) {

var 
this_ that;


 var 
collect "";

 $(
'.productID-zubehoer').each( function( isearchkey ) {                 
            
  var 
searchkey = $(searchkey).text();
  
            
           
  var 
keyvalues searchkey.split('/');
   
      var 
keyLength keyvalues.length;
      
      
      var 
productZID = $(this).closest('td').parent('tr').attr('class');
      
      var 
colorIndex 0;
      
      var 
price 0;
      
      var 
multiplicaton_of_price 0;
               
      $.
each(keyvalues, function( fkey ) {
      
              var 
1;
              
               
              
              var 
color = $('input[name=colorforallequipment]').val();
              
              var 
colorConfigIndex parseInt($('.' productZID ' input[name=ist_farbe]').val());
              
              var 
color_index parseInt($('.' productZID ' input[name=ist_farbe]').val()) + 1;
                                              
              if(
color_index != undefined && == color_index && color != "") {  
                                       
              
collect += color.replace('/''');
              
              if(
this_.settings.product_config.affects_globals == 0) {  
                                 
                      
colorIndex this_.settings.product_config.productkeys[colorConfigIndex].indexOf(color);
                                        
                      
price this_.settings.product_config.priceConfig[colorIndex];
                                        
                                        
                      var 
witchPrice price.split(':');
                      
                      if(
witchPrice[0] == "a")
                      
multiplicaton_of_price = (((witchPrice[1] * 100) / this_.settings.product_config.total_price) / 100) + 1;
                      else
                      
multiplicaton_of_price witchPrice[1];
                                           
                      var 
newPrice this_.settings.product_config.total_price multiplicaton_of_price;
                      
                      
                      var 
totalSum newPrice.toFixed(2);
                    
                      var 
sumTohidden =  newPrice.toFixed(2); 
                                  
                      $(
'.product_' this_.settings.product_config.product_id '  .zubehoer-preis span').html(totalSum);
                   
                      $(
'.product_' this_.settings.product_config.product_id '  .total').val(sumTohidden); 
                      
                      $(
'.product_' this_.settings.product_config.product_id ' td div div button').attr('item-price'sumTohidden);
              
              } else { 
              
// im Prinzip soll der Code in der if clause (also nicht else clause) mit einem neuen this (mit der Class productZID ) vesehen werden
                      
var instance = $('.' productZID).productConfig;
                      
                      
alert(instance//gibt die unten stehende fn aus
                       
                      
              
}
                                   
              } else {           
        
              
collect += key;
        
              }
               
              if(
keyLength k)   
              
collect += "/";        
         
      }); 
      
           
   $(
this).html(collect);
   
   
collect "";
       
   }); 

           
 
    
  
    
  }
  
  });

        
// A really lightweight plugin wrapper around the constructor,
        // preventing against multiple instantiations
        
$.fnpluginName ] = function( options ) {
            return 
this.each( function() {
                if ( !$.
datathis"plugin_" pluginName ) ) {
                    $.
datathis"plugin_" +
                        
pluginName, new Pluginthisoptions ) );
                }
            } );
        };

} )( 
jQuerywindowdocument );