掲示板
A.plugin.io substitude in Alloyui 2+
8年前 に Johan de jong によって更新されました。
A.plugin.io substitude in Alloyui 2+
Junior Member 投稿: 41 参加年月日: 12/02/06 最新の投稿
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//
});
8年前 に Julien Mourad によって更新されました。
RE: A.plugin.io substitude in Alloyui 2+
Junior Member 投稿: 78 参加年月日: 15/01/22 最新の投稿
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') );
}
}
});
}
);