<ul data-role="listview">
<li>
option one<br />
<a href="mailto:sample@email.com">sample@email.com</a><br /> <a href=tel:1231231234">123-123-1234</a> </li> <li> option two<br /> <div onclick="window.location.href = 'mailto:sample@email.com';">sample@email.com</div>
<div onclick="window.location.href = 'tel:1231231234';">123-123-1234</div> </li>
</ul>
1 Answer, 1 is accepted
You must specify, that you want to navigate to an external link using 'data-rel="external"' attribute. It still won't work in the simulator, because this functionality is not implemented inside it yet. However it will work as expected on real devices. You should modify your code like so:
<
ul
data-role
=
"listview"
>
<
li
>
<
a
href
=
"mailto:sample@email.com"
data-rel
=
"external"
>sample@email.com</
a
><
br
/>
<
a
href
=
"tel:1231231234"
data-rel
=
"external"
>123-123-1234</
a
>
</
li
>
</
ul
>
Regards,
Kristian D. Dimitrov
the Telerik team
Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
<li>
<h3>Title</h3>
<p>
<a data-rel="external" href="mailto:test@test.com">test@test.com</a><br />
<a data-rel="external" href="tel:1231231234">(123) 123-1234</a>
</p>
</li>
<div data-role="view" id="tabstrip-otherlinks" data-title="Other Links">
<h1>Other Links</h1>
<ul data-role="listview">
<li data-icon="globe">
<a data-rel="external" href="http://www.test.org/" target="_blank">Website</a>
</li>
<li data-icon="pinterest">
<a data-rel="external" href="http://pinterest.com/" target="_blank">Pinterest</a>
</li>
</ul>
</div>
In addition to:
1) linking the user to sites in the phone's native browser app and
2) linking with mailto: and tel: links
I'd also like to know:
3) how to open a link to an embedded PDF in the native browser app.
Thanks!
For the issue with "mailto:" and "tel:" just update the Kendo Mobile with the latest version shipped with Icenium (v2012.3.1315) and this should solve it. To update Kendo just copy the Kendo files(or their content) from a new blank Kendo Mobile project.
To open sites in the default browser you should modify your code as shown below.
HTML:
<
ul
data-role
=
"listview"
data-click
=
"navigateToAddress"
>
<
li
data-icon
=
"globe"
>
<
a
data-rel
=
"external"
data-link
=
"somelink.com"
target
=
"_blank"
>Somelink</
a
>
</
li
>
</
ul
>
JavaScript:
navigateToAddress =
function
(e){
var
that =
this
,
data = e.target.data();
if
(device.platform.toLowerCase() ===
"android"
){
navigator.app.loadUrl(data.link, { openExternal:
true
} );
}
else
{
window.location.href = data.link;
}
}
We made a sample application to demonstrate open PDF file in both Android and iOS using Icenium and the Child Browser plugin. Everyone can Clone it from Sample Projects in Graphite or Mist. Note that plugins do not work in simulators, so test on real device only.
You might want to hide the Android splash-screen as soon as Cordova fires "deviceready" event. To do so, just add the following line of code inside the "deviceready" handler:
function
onDeviceReady() {
navigator.splashscreen.hide();
}
Greetings,
Kristian D. Dimitrov
the Telerik team
Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
<div data-role="navbar">
<a id="btnUploadPics" data-click="uploadPics" data-role="button" data-align="right">Add Photos</a>
</div>
function uploadPics() {
var sLink = "mailto:test@test.com?subject=test";
window.open(sLink, "emailWindow");
}
window.location.href = "mailto:test@test.com"
window.location = "mailto:test@test.com"
Nothing seems to work. Now I get a 'null' in the recipient and nothing else.
I updated kendo to 2013.3.1119 version and the code below works perfect. Your code works as well, but it opens the link in the browser first so I modified it.
app.upl=function () {
var sLink = "mailto:test@test.com?subject=test";
//window.open(sLink, "emailWindow");
window.location.href=sLink;
};
<
div
data-role
=
"navbar"
>
<
a
data-rel
=
"external"
id
=
"btnUploadPics"
data-click
=
"app.upl"
data-role
=
"button"
data-align
=
"right"
>Add Photos</
a
>
</
div
>
If you send me your project I could take a look.
Thanks.
Regards,
Zdravko
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Hi,
Im using appBuilder extension on visual studios 2015 rc and im using Kendo UI to build an app..
<ul data-role="listview">
<li>
<a class="btn" data-rel="external" target="_blank" data-role="touch" href="tel:01628788788">Call us</a>
<a class="btn" data-rel="external" target="_blank" data-role="touch" href="mailto:info@parkcarsexecutive.com?subject=Contact via App">Mail us</a>
</li>
</ul>
both links are doing nothing on android phone.. I haven't tested it on iOS.
Can someone please help me?
more details:
OS: windows 7, Visual studios 2015rc with AppBuilder Extension, Kendo UI with Tabstrip template
Thank you for contacting us. I am afraid I was not able to reproduce the issue.
I have tested your exact code snippet on Android 4.0.4 and 5.0 device:
- The "tel:*" link opens the dialer with the number already in.
- The "mailto:*" opens a popup to choose a mail client.
The Kendo UI version was Kendo UI Core v2014.1.624 which is the default version coming with the template. I also tested with an updated version - Kendo UI Core v2015.2.727.
Users have experienced issues with external links after Cordova 3.6 was released as external links had to be explicitly white listed. We have already addressed the issue by extending the default configuration files. You can find more information in the External Application Whitelist section of this article. You can also check this Stack Overflow thread.
Here is a useful link about how to access the configuration files for the different platforms inside an AppBuilder project. Make sure your configuration files white list the tel: and mailto: links. If that doesn't help, please send over your project so we can further investigate the issue.
Regards,
Ventsislav Georgiev
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
Hi
I tested your code in Js.do you forgotten a quote. I added in only the phone link work and launch my skype. I put a real email address to see if it open my email or outlook but it does nothing.
<html>
<body>
<ul data-role="listview">
<li>
option one<br />
<a href="mailto:girlfridayz@girlfridayz.com" data-rel="external">sample@email.com</a><br />
<a href="tel:1231231234" data-rel="external">123-123-1234</a>
</li>
<li>
option two<br />
<div onclick="window.location.href= 'mailto:girlfridayz@girlfridayz.com';">sample@email.com</div>
<div onclick="window.location.href = 'tel:1231231234';">123-123-1234</div>
</li>
</ul>
</body>
Hi,
I have a doubt how will the '' behave when there is no email client application in mobile devices