PDA

View Full Version : ExtJS and WRTKit Store won't load!



eyurdakul
13 Oct 2009, 7:38 AM
Hi friends,

i am currently writing a simple widget for mobile Nokia Symbian platform. Nokia provides WRTKit which is a javascript/HTML wrapper with some extra features like get location, battery level, check bluetooth availability just like Adobe AIR. Now i am using ExtJS and WRTKit together but i am unable to launch AJAX calls. I've been looking into example codes and it seems WRTKit has no problems with cross-domain ajax calls (just like air again) but i can't launch any cross domain request.



var contentStore = new Ext.data.JsonStore({
proxy: new Ext.data.ScriptTagProxy({
url: 'http://local.somedomains.com/module/controller/action'
}),
baseParams: {
isWorld: 1,
uniqueId: 1
},
root: 'root',
fields: ['title', 'url', {name:'isWorld', type:'integer'}, {name:'uniqueId', type: 'integer'}],
autoLoad: true
});


If i use a relative domain like '/index/etc' and HttpProxy instead of ScriptTag, the ajax call launches (and gives not found errors of course). I try the same script in firefox instead of Aptana symbian emulator, but the result is same. Does anybody have an idea why that happens?

p.s. i am adding wrtkit library before extjs. i've tried many combinations of HttpProxy and ScriptTagProxy. i've googled like crazy.

eyurdakul
14 Oct 2009, 12:55 AM
I've changed my code according to this thread:
http://www.extjs.com/forum/showthread.php?t=23074

but the result is still same. I just don't see any http request fired in firebug.


var contentStore = new Ext.data.Store({
url: 'http://local.storynations.com/mobile/symbian/index',
reader: new Ext.data.JsonReader({
root: 'root',
fields: ['title', 'url', {name:'isWorld', type:'integer'}, {name:'uniqueId', type: 'integer'}],
idProperty: 'uniqueId'
}),
autoLoad: true
});

var contentTpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="c_wrapper"><img src="{url}" title="{title}" class="c_thumb" />',
'<p class="c_title">{title}</p></div>',
'</tpl>'
);
var contentView = new Ext.DataView({
store: contentStore,
tpl: contentTpl,
height: 200,
//autoHeight: true,
emptyText: 'No content to show',
overClass: 'c_wrapper_over',
itemSelector: 'c_wrapper_select',
listeners: {
selectionchange: function(){
alert('selected');
}
}
});

cmendez21
17 Nov 2009, 12:17 AM
I'm currently into the same problem
AND the Scripttagproxy is such a mess in my opinion and even i tried all proxyes no answer but it may be security restriction from the phone security

what i did "some solution so far"

If i load the data as a javascript file (array data) it works and loading remote Js files works
its weird but its how the phones handle the security :D

the bad its that i cant reload the store :(