Page 1 of 2

How to add a button to an rss feed

Posted: Thu Aug 08, 2013 4:12 pm
by 3dbounce

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


How to add a button to an rss feed

Posted: Thu Aug 08, 2013 4:50 pm
by maxkatz

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


How to add a button to an rss feed

Posted: Thu Aug 08, 2013 4:54 pm
by Oleg Danchenkov

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());


How to add a button to an rss feed

Posted: Fri Aug 09, 2013 10:53 am
by 3dbounce

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?


How to add a button to an rss feed

Posted: Fri Aug 09, 2013 11:35 am
by Kateryna Grynko

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(...)


How to add a button to an rss feed

Posted: Fri Aug 09, 2013 11:55 am
by 3dbounce

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

Thanks


How to add a button to an rss feed

Posted: Fri Aug 09, 2013 12:04 pm
by Kateryna Grynko

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


How to add a button to an rss feed

Posted: Thu Sep 05, 2013 1:50 pm
by 3dbounce

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


How to add a button to an rss feed

Posted: Thu Sep 05, 2013 4:54 pm
by Maryna Brodina

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


How to add a button to an rss feed

Posted: Thu Sep 05, 2013 5:21 pm
by Maryna Brodina

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