Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is something missing in your examples which is how EH_SortableRecieve is called. But based on what you say it should be used as I'm thinking it is used something like this:</p> <pre><code>htmlelement.onmouseup = shippingObject.EH_SortableRecieve; </code></pre> <p>In which case you should be aware of Javascript's binding of <code>this</code> in methods. Specifacally, in event handlers <code>this</code> is bound to the <code>window</code> object instead of the object the method belongs to. This is a general feature of javascript: methods can be re-bound at runtime. In other words, objects can steal other object's methods. For example, I can have my object <code>slebetmans_object</code> steal your method and re-bind its <code>this</code> with the following:</p> <pre><code>shippingObject.EH_SortableRecieve.apply(slebetmans_object,parameters); </code></pre> <p>There are several strategies to get around this. You can use a closure to capture your object:</p> <pre><code>htmlelement.onmouseup = function(){ shippingObject.EH_SortableRecieve() }; </code></pre> <p>You can use a closure in the object's constructor to capture the correct reference to your object:</p> <pre><code>function ShippingUI () { var self = this; // since self is resolved at the time the object is created // it always reference to the "correct" object this.EH_SortableRecieve = function(event, ui) { self.UpdateItemQTYs('ABCD',123); } } </code></pre> <p>There are probably other ways to do this but these are the two most common that I personally use.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload