Ho il codice:
codice:
function deliveryClass(/* Integer */ deliveryId,/* Integer */ customerId)
{
this.updateProductsGrid = function()
{
[...]
}
this.modifyDelivery = function(customer)
{
dojo.xhrPost({
[...]
load: function(data,args)
{
this.updateProductsGrid();
}
});
}
}
Essendo una classe mi aspetterei di usare sempre il selettore this per metodi non statici. Però qui non viene accettato quello in grassetto (e pensandoci il motivo mi è chiaro).
In suo luogo, il programma accetta ad esempio:
codice:
Delivery = new deliveryClass(1,2);
function deliveryClass(/* Integer */ deliveryId,/* Integer */ customerId)
{
this.updateProductsGrid = function()
{
[...]
}
this.modifyDelivery = function(customer)
{
dojo.xhrPost({
[...]
load: function(data,args)
{
Delivery.updateProductsGrid();
}
});
}
}
Domanda: come posso tornare a poter usare il selettore this?