There’s a bug on sencha 2.3 about event orientationChange of viewport
This event isn’t fired: a workaround for this is to create a subcription on app launch
Ext.Viewport.bodyElement.on('resize', Ext.emptyFn, this, { buffer: 1});
There’s a bug on sencha 2.3 about event orientationChange of viewport
This event isn’t fired: a workaround for this is to create a subcription on app launch
Ext.Viewport.bodyElement.on('resize', Ext.emptyFn, this, { buffer: 1});
My sencha cmd create me some problems on compilation because it can’t take enough memory!
The building show an error about java heap space after a stop of some minutes.
...myProject\app\.sencha\app\build-impl. xml:158: com.sencha.exceptions. ExScript: Wrapped com.sencha.exceptions.BasicException: <strong><em> Java heap space</em></strong> (x-app-build#291)
So.. to increase it, you open sencha.cfg in ..\Sencha\Cmd\xxxVersionxxx\ search md.jvm.args variable and increase its value!
I have to delimitate the overflow text in a html: I’m happy to know that a css class is enought to accomplish that!
This link explains the text-overflow css property!
https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow
Opera usees a different property
p {
white-space: nowrap;
width: 100%;
overflow: hidden; /* "overflow" value must be different from "visible" */
text-overflow: ellipsis; /* IE 6+, FF 7+, WebKit (Safari, Chrome), Opera 11+*/
-o-text-overflow: ellipsis; /* Opera 9 e 10 */
}
To change a value of a Ext field without firing events it’s enough suspend events, do the action and reactive the events!
field.suspendEvents(false); field.setValue(newValue); field.resumeEvents();
Finally google added a method to allow to track down a device registered on our profile!
Now, not only Apple users can find their iPhone (by Find my IPhone feature), infact google introduced Android device manager about a month ago!
To access it open following link:
https://www.google.com/android/devicemanager
or, go to playstore page, open setting and click “mange device” item.
It’s important enable this function on device.
From google https://support.google.com/accounts/answer/3265955?p=android_device_manager&rd=1&hl=en
Turn on Android Device Manager
Note: If you’re using a tablet with multiple users, only the tablet owner can manage the settings for Android Device Manager.
- Open
Google Settings from your device’s apps menu.
- Touch Android Device Manager.
You can turn on the following options:
- Remotely locate this device. Remotely locate a device and find its approximate location on Google Maps. For devices running 4.1 and higher, location access must also be enabled. To turn it on, go to Google Settings > Location > Access location.
- Allow remote factory reset. Remotely erase all data on your device. Touch this option, then select Activate to turn on the device administrator.
I’m developing a sencha touch app and I need to manage errors of every ajax call! The most simple solution consist of subscribe to every call and manage response but it’s very repetitive and I don’t like it!
The solution I choose is to extend base class of Connection and override response method.
In the launch method of app.js I added this code:
Ext.define('Ext.data.myConnection', {
override: 'Ext.data.Connection',
onComplete : function(request) {
var response = this.callParent([request]);
if(!request.options.disableLoginRedirect){
if(response.status != 200){
var extraMsg = 'response code: ' + response.status;
Ext.callback(Ext.goToLogin, this, [extraMsg]);
}else if(response.responseText){
try{
//parse json resposne
var resObj = Ext.JSON.decode(response.responseText);
if(resObj && !resObj.success &&
resObj.code === Ext.errorCodes.NOT_LOGGED){
Ext.callback(Ext.goToLogin, this, ['Not logged!']););
}
}catch(e){
}
}
}
return response;
}
});
With this code every ajax call will be verified automatically.
In case of you want avoid this behavior for some request it will enought add ‘disableLoginRedirect=true’ in the request options!
Ext.Ajax.request({
url: requestUrl,
disableLoginRedirect : true, //this options!!!!
....
success:
...
},
failure: function(response, opts) {
...
}
});
If you are using JSONP the class to modify is:
Ext.define('Ext.data.proxy.myJsonP', {
override: 'Ext.data.proxy.JsonP',
createRequestCallback: function(request, operation, callback, scope) {
var jsonPme = this;
return function(success, response, errorType) {
delete jsonPme.lastRequest;
//console.log('jsonp callback');
if(success && response){
if(!response.success && response.code === Ext.errorCodes.NOT_LOGGED && (!request.options || !request.options.disableLoginRedirect)){
var extraMsg = 'not logged!';
Ext.callback(Ext.goToLogin, this, [extraMsg]);
}else{
jsonPme.processResponse(success, operation, request, response, callback, scope);
}
}
};
}
});
Demo effect: too many user = too many client = web server KO!
Argh!
I started to view “big bang theory” in streaming! The first step was to connect the tv to the pc with an HDMI cable: Now I could view the series comfortably lying down on my bed! ![IMG_20130722_204356[1]](https://th3nu11.wordpress.com/wp-content/uploads/2013/07/img_20130722_2043561.jpg?w=300&h=224)
But the problem was that… I had to get up every time to start the next episode…
mmmm maybe ..
To allow cross-domain in asp.net it’s enough to modify web.config file adding this configuration:
<system.webServer>
...
...
...
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Headers" value="accept, maxdataserviceversion, origin, x-requested-with, dataserviceversion, Content-Type" />
<!--<add name="Access-Control-Allow-Origin" value="*" />-->
<add name="Access-Control-Request-Headers" value="X-Custom-Header" />
<add name="Access-Control-Max-Age" value="1728000" />
<add name="Access-Control-Allow-Methods" value="OPTIONS, GET, POST, PUT, DELETE" />
<add name="Access-Control-Allow-Credentials" value="true" />
</customHeaders>
</httpProtocol>
<directoryBrowse enabled="true" />
<security>
<requestFiltering>
<fileExtensions>
<add fileExtension=".json" allowed="true" />
</fileExtensions>
<verbs>
<add verb="GET" allowed="true" />
<add verb="POST" allowed="true" />
<add verb="OPTIONS" allowed="true" />
<add verb="DELETE" allowed="true" />
<add verb="PUT" allowed="true" />
<add verb="REMOVE" allowed="true" />
</verbs>
</requestFiltering>
</security>
...
...
...
If you are using Chrome you don’t need any other configurations. If you user Safari (and iphone app built with phonegap, sencha cmd ecc..) you need to add in global.asax:
void Application_PreSendRequestHeaders(Object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
And in web.xml add
<authentication mode="Forms"> <forms cookieless="UseCookies"/> </authentication