PDA

View Full Version : extjs 4.1 carousel



javapurna
3 Jun 2013, 4:29 AM
hi every one ,

i have a requirement to display sliding content on panel(carousel). i am using extjs 4.1 . i am found examples but it is not working .

some of examples sites :

1) http://dev.sencha.com/playpen/ext-core-latest/examples/carousel/



can any one please suggest me how to do.

slemmon
5 Jun 2013, 11:13 AM
I've not seen the Core Carousel example integrated into an Ext widget - though it'd certainly be possible.
You'll just need to examine how the Carousel example is put together and render it to a panel's html config / body or something to that effect.

javapurna
5 Jun 2013, 8:36 PM
thanks for replying .
in emergency of releasing my weekly build to client , i am trying to do this . please suggest me better way of doing this task.

following are my code:

panel:

var req = Ext.create('Ext.panel.Panel', { width: '100%',
height: 300,
id: 'DynamicCurosel1',
items: [{
xtype: 'label',


id: 'DynamicCurosel',
text: runner
}
]


});

Task Runner:

var task = {
run: function () {
var item1 = " item one text ";
var item2 = " item2 text";
var item3 = " item3 text";
var notifications = [];
notifications.push(item1);
notifications.push(item2);
notifications.push(item3);
var DynamicCurosel = Ext.getCmp('DynamicCurosel');
Ext.get("DynamicCurosel").fadeIn({
opacity: 1,
easing: 'easeOut',
duration: 10000
});
Ext.get("DynamicCurosel").fadeOut({
opacity: 0,
easing: 'easeOut',
duration: 10000,


});
//DynamicCurosel.setText('<b>New</b> value...', false);


DynamicCurosel.setText(notifications[Math.floor(Math.random() * 3)], false);
},
interval: 10000 // every 30 seconds
};
var runner = new Ext.util.TaskRunner();
runner.start(task);