4

I am using sencha touch. Can i call parametrized handler function on an item of action sheet ? If yes then how to do this. Kindly help me .. I want to do this ,,

var z = function test(){alert('Hellow')};

In the handler function :

handler:function(z){
    alert(z);
}

it is not working .. Just showing .. "Index.html (Object:Object)" Thanx in advance

1 Answer 1

2

Yes, you can do this but this is based on the parameters provided by the caller of the handler. In case of it button this would be the 'click' event. But you can always view all passed arguments when reading the arguments array like

handler:function(){
    console.log(arguments);
}

and if you know that there is for example one argument you know you (lets take the button) can define it

handler:function(btn){
    btn.disable();
}

You also need to know that alert is not capable of printing JavaScript Objects! Use console.log for this.

Sign up to request clarification or add additional context in comments.

3 Comments

Its not working. Actually i want to access the photolibrary of the Mobile through tap on the items of action sheet .. I am using phone gap to do this. U may know that phonegap's function getPhoto(source) takes a parameter i want to call this in my handler function could u please help ?? Kindly change your second answer to first one. Thanks
@BurhanMughal Then you should alter your question cause no one will know what you are trying to archive and what I wrote is is correct in the context you asked the question. I must say that I can't follow you so you should really alter your question. And Kindly change your second answer to first one what do you mean by that?
I was saying that please if have experience of this then please give me the answer how to do this ..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.