-
24 Apr 2012 12:09 AM #1
Answered: Facebook like button in floating panel
Answered: Facebook like button in floating panel
I have been working on an application using sencha touch 2 .
I have a toolbar on top which contains a button .
When i click this button i will have a panel overlay .
In this panel,i want to have two items :
Code:var shareButton = { xtype : 'button', ui: 'action', width:'36px', height:'36px', handler : function(){ var panel=Ext.create('Ext.Panel',{ right: 0, top: 20, modal: true, hideOnMaskTap: true, hidden: true, width: 260, height:'70%' , styleHtmlContent: true, scrollable: true, items: [ {html:'<a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.google.com" data-lang="en">Tweet</a>',}, {html:'<div ><class="fb-like" data-href="http://test.com" data-send="false" data-layout="button_count" data-width="4" data-show-faces="false"></div>'}]}); Ext.Viewport.add(panel); panel.show();}};
But this is not working.
In fact,i want the first one to direct me to twitter to share the URL (www.google.com).
And the second one to facebook to share "test.com".
Unfortunately , the word tweet only appears which allows me to access twitter.com
Thank you.
-
Best Answer Posted by krystelan
Thank you.
I have resolved this thread.
Actually ,since the overlay is called after the page is loaded, the facebook and twitter buttons should rendered again
This is the code that should be added after the overlay is shown
Code:FB.XFBML.parse();//facebook $.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache:true}); //twitter
-
25 Apr 2012 11:39 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,623
- Vote Rating
- 434
- Answers
- 3103
Where are you having the facebook api make the button?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
26 Apr 2012 12:34 AM #3
Thank you.
I have resolved this thread.
Actually ,since the overlay is called after the page is loaded, the facebook and twitter buttons should rendered again
This is the code that should be added after the overlay is shown
Code:FB.XFBML.parse();//facebook $.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache:true}); //twitter
-
27 Apr 2012 4:48 PM #4
is it possible to use a like button within iOS and/or Android? That would be a big win. It seems like Facebook authentication would be an issue.
If it were possible to Like/Send/Subscribe within Sencha Touch (in iOS/Android) it would be a *big* win. I've been unable to find an answer for this. I'd really like to avoid the complexities of Facebook Connect and if the above were possible that would save a lot of coding.


Reply With Quote