-
21 May 2012 6:49 AM #1
Unanswered: cannot load image from internet with the device
Unanswered: cannot load image from internet with the device
i use sencha touch 2 with PhoneGap(Cordova)
i load images from the internet and use them in the listview. When I launch my app in desktop browser, image loads fast and goes to the listview item. BUT on the device image cannot load
-
23 May 2012 4:57 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,674
- Vote Rating
- 435
- Answers
- 3110
Is it a connection issue? Are the images large?
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.
-
23 May 2012 5:24 AM #3
no the connection is not issue and the same image when i use it from local it will display but from the internet the image cannot load
i will describe the probleme with a sample code
Ext.define('MyApp.view.ImageContainer', {
extend: 'Ext.Container',
alias: 'widget.ImageContainer',
config: {
items: [
{
xtype: 'image',
height: 201,
id: 'MyImage',
src: 'http://www.sencha.com/assets/images/sencha-avatar-64x64.png'
},
{
xtype: 'panel',
//flex: 2,
html: 'Sencha Inc.<br/>1700 Seaport Boulevard Suite 120, Redwood City, CA'
}
]
},
});
record.details = Ext.create('MyApp.view.ImageContainer', {
title: record.get('text')
});
// set the src of image
var image = record.details.child('#MyImage');
//image.setSrc(record.get('res'));
image.setSrc("../localfile.png");
it's work with a local file
but when i set the Src with an url from the internet it's not work
the same probleme when i use Ext.video if i use a local file it's work but a distant file it's not work
against when i use Ext.video and url from the internet it's work
-
23 May 2012 6:23 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,674
- Vote Rating
- 435
- Answers
- 3110
I Used this test case and it took a bit for the new image to be downloaded but it did show after a couple seconds:
Code:var cnt = new MyApp.view.ImageContainer({ fullscreen : true }); var image = cnt.down('image'); image.setSrc('http://www.sencha.com/files/blog/old/blog/wp-content/uploads/2010/06/sencha-logo.png');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.


Reply With Quote