3dbounce
Posts: 0
Joined: Sat May 18, 2013 9:58 am

How to add a button to an rss feed

Hi,

I'm wondering how you can use a button in an rss feed to take you to an external link. I currently have other rss feeds in my app so i understand how to map things. The problem is that the button does not have a URL property for me to link it to.

Any ideas?

Example:
Image

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to add a button to an rss feed

You can add a click event, run JavaScript to navigate to a page.

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

How to add a button to an rss feed

Yes, button does not have url property. You can map url to invisible label (add it to grid cell with button) and add action on button click event. For example add this JS code on button click
window.open($(this).parents("td").eq(0).find("[dsid=hiddenLabelName]").text());

3dbounce
Posts: 0
Joined: Sat May 18, 2013 9:58 am

How to add a button to an rss feed

Hi,

This works great in the browser but when i try it on my android phone (using your app) it doesn't work. Any ideas why?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to add a button to an rss feed

Hi,

Create JS asset:
precodefunction myNavigate(url) {
var cb;
if (window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
} else {
window.open(url);
};
}/code/pre
Replace window.open(...) with myNavigate(...)

3dbounce
Posts: 0
Joined: Sat May 18, 2013 9:58 am

How to add a button to an rss feed

what browser does this open? Is there a way to open it in their preferred browser?

Thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to add a button to an rss feed

You would need to try. I suppose it depends on device settings and installed browsers.

3dbounce
Posts: 0
Joined: Sat May 18, 2013 9:58 am

How to add a button to an rss feed

Hi, sorry to start up an old subject but it seems that PDF's do not load or download when using the "childBrowser." Is there another way of doing this?

Thanks
grant

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to add a button to an rss feed

Hello! To download PDF file from Appery.io you have to open PDF link in standard browser with codewindow.open(url, "system")/code
You can rewrite myNavigate function this way:
codefunction myNavigate(url) {
if (/function myNavigate(url) {
if (/\.pdf$/i.test(url)) {
//If url ends with ".PDF" then open it in system browser
window.open(url, 'system');
} else {
var cb;
if (window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
} else {
window.open(url);
};
}
}
#46;pdf$/i.test(url)) {
//If url ends with ".PDF" then open it in system browser
window.open(url, '_system');
} else {
var cb;
if (window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
} else {
window.open(url);
};
}
}
/code

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to add a button to an rss feed

Sorry, I can't paste correct code, there are some additional symbols added. See the screenshot. You only need first part of code above:
Image

Return to “Issues”