Fórum
A.plugin.io substitude in Alloyui 2+
Johan de jong, modificado 8 Anos atrás.
A.plugin.io substitude in Alloyui 2+
Junior Member Postagens: 41 Data de Entrada: 06/02/12 Postagens Recentes
In Liferay 6.1 I use A.plugin.io for a tabbed view ( aui-tabs) where each tab contains refresh-able information.
On my move to 6.2+ i see that the A.plugin.io is not available. So i can not plug every tab to an io periodic refresh anymore.
Does anyone know a substitute for this?
old code example:
On my move to 6.2+ i see that the A.plugin.io is not available. So i can not plug every tab to an io periodic refresh anymore.
Does anyone know a substitute for this?
old code example:
AUI().use('aui-tabview','aui-io-request',function (A) {
var myCounter=0;
var target1 = A.one('#tab1');
target1.plug(A.Plugin.IO, {
failureMessage: 'loading section.',
autoLoad: true,
hideLoading:true,
cache: false,
uri: 'some_uri'
});
var bax;
bax=setInterval(function() {target1.io.start();myCounter++; if (myCounter>20) { location.reload(true);} },8000);
// above line is needed when the loaded file was large and some browser accidentally keep caching the page after every refresh//
});
Julien Mourad, modificado 8 Anos atrás.
RE: A.plugin.io substitude in Alloyui 2+
Junior Member Postagens: 78 Data de Entrada: 22/01/15 Postagens Recentes
AUI().use(
'aui-tabview',
'aui-io-request',
'io-plugin',
function (A) {
var myCounter=0;
var target1 = A.one('#tab1');
target1.plug( A.Plugin.IO, { uri: 'test.html' } );
}
);
As an alternative, you can use:
AUI().use(
'aui-tabview',
'aui-io-request',
function (A) {
var myCounter=0;
var target1 = A.one('#tab1');
target1.html('<div class="loading-animation"></div>');
A.io.request( 'test.html' , {
on: {
success: function(event, id, xhr) {
target1.html( this.get('responseData') );
}
}
});
}
);