onItemClick

fires when a component item was clicked

void onItemClick(string id,Event e,HTMLElement node);
idstringthe id of the clicked item
eEventa native event object
nodeHTMLElementthe target HTML element

Example

list.attachEvent("onItemClick", function(id, e, node){
    var item = this.getItem(id);
    //... some code here ... 
});

Related samples

Details

The most common use case for such events is getting info about the component item that has just been clicked. It can be done with a common getItem method that requires item ID as parameter.

See also
Back to top