I am developing a worklight project using DOJO toolkit.Since i am a newbie in Worklight and Dojo i just created a list and trying to get get the index of clicked list,so that i can show corresponding description/action in the next view. i tried passing index value in listItem "onClick " function,but after passing index parameter i cant move to anothe view.
HTML File
<div data-dojo-type="dojox.mobile.ScrollableView" id="view0"
data-dojo-props="selected:false,scrollDir:'v'">
<div data-dojo-type="dojox.mobile.Heading"
data-dojo-props="label:'View0'" ></div>
<ul data-dojo-type="dojox.mobile.RoundRectList" id="dataList">
</ul>
<div data-dojo-type="dojox.mobile.Heading"
data-dojo-props="fixed:'bottom'"></div>
</div>
JS File
function abcd()
{
..
...
...
var dlist = dijit.registry.byId("view0");
for(var i=1;i<=3;i++)
{
var lstId = "list" + i;
var list = new dojox.mobile.ListItem({label: labl,rightIcon:"mblDomButtonBlueCircleArrow",transition:"slide",id:lstId,onClick:dispData(lstId),moveTo:"#"});
}
dlist.addChild(list);
}
function dispData(index)
{
//debugger;
alert(index);
dijit.registry.byId("view0").performTransition("**someview***", 1, "slide");
}
How to get the index value of selected list in dojo.Is there any other method to do this.
Any help is appreciated.