I am creating a sencha-touch base carousel for displaying images, one at a time. On top of the Carousel is a dockedItem. In that I want to display the serial no of the image (i.e 1 of 5 etc.).
我无法确定哪些活动应当处理,或我应采用何种方法更新案文。
我正在使用“塞察”触线1.1。
这里是我的卡兹尔法典:
var carousel= new Ext.Carousel({
fullscreen: true,
dockedItems: [{
overlay: true,
dock: top ,
xtype: toolbar ,
style: opacity: 0.6; ,
items:[{
xtype: button ,
text: "Main menu",
},
{ xtype: spacer },
{
text: ,
ui: action ,
listeners:
{
onCreate : function ()
{
console.log(this.getActiveIndex().toString());
this.text=this.getActiveIndex().toString();
this.doLayout();
},
}
}
],
listeners:
{
launch : function ()
{
console.log(this.getActiveIndex().toString());
this.text=this.getActiveIndex().toString();
this.doLayout();
},
}
},
{
overlay: false,
dock: bottom ,
xtype: toolbar ,
style: opacity: 0.75; ,
items:
{
html: <img style="display: block; margin-left: auto; margin-right: auto;" alt="" src="images/options.png" onclick="return loadOptionPage();">
}
}],
layout: card ,
items:[
{
cls: "figure1 figure"
},
{
cls: "figure2 figure"
},
{
cls: "figure3 figure"
},
{
cls: "figure4 figure"
},
{
cls: "figure5 figure"
}
],
listeners: {
cardswitch:
{
fn: function()
{
//alert(this.getActiveIndex() );
var indx=this.getActiveIndex();
var str= ;
str="hello"+indx.toString();
this.dockedItems.items[1].html="<div>"+str+"</div>";
carousel.doComponentLayout();
console.log(str);
this.doLayout();
}
},
}
});