-
10 Apr 2012 10:23 AM #1
CityBars Call Button
CityBars Call Button
Hi...
I'm very interested in adding a call button in an app, much the same as the city bars example, but the video doesn't take us through the steps.
I've set up a listener on the call button, but I'm not sure how to pass the phone number data to window.location. It is set up as a field in my model similar to cityBars
Code:Ext.Msg.confirm('Call', 'Would you like to call ?', function(res){ if (res == 'yes') { window.location = ?????; } }, this);
-
11 Apr 2012 6:15 AM #2
I know I could always define HTML and use an anchor tag outside of a div with the class x-button to achieve the same effect, but I was hoping to learn how to get at record data from inside a function. I can see this being a valuable tool to have in other scenarios.
this function is defined on the detail Page that the record.data is being passed to. It seems like there should be a way to get at the info.Code:onCallTap:function(button, e, options) { Ext.Msg.confirm('Call?', 'Are you sure you want to call?', function(ans){ if (ans == 'yes') { window.location = ?? } }, this); }
-
11 Apr 2012 8:53 AM #3
Aaron Conran
@aconran
Sencha Architect Development Team
-
11 Apr 2012 9:38 AM #4
Thanks, Aaron...
I should have clarified. I'm familiar with the tel: protocol.
The problem was that I wasn't properly passing the data from my list view controller to the detail view, so when trying to access the phone number data in my function residing in the detail view, it was coming back as undefined. But I figured it out.
Love Designer. You guys are doing amazing work. Probably should pony up for a premium forum membership.
-
11 Apr 2012 9:44 AM #5
Glad you figured it out.
Thanks for the kind words
Aaron Conran
@aconran
Sencha Architect Development Team
-
19 Apr 2012 12:43 AM #6
Thanks for the updates Phil.
Just a question how can you use "window.location = ??" to work the same as the tel anchor link.
I've tried" window.location.href = "tel:+3539352112";" but this does not work.
Thanks
-
19 Apr 2012 6:31 AM #7
You don't need ".href" at the end of window.location:
This should accomplish what you want and is essentially the javascript version of an html anchor tagCode:window.location = 'tel:2125551212';
I believe window.open will accomplish the same thing.


Reply With Quote