Opened 11 years ago

Closed 11 years ago

#13605 closed defect (invalid)

DataList: ListItem.onClick() not Invoked if onClick handler is specified in data source

Reported by: Ming Zhe Huang Owned by: ykami
Priority: high Milestone: tbd
Component: DojoX Mobile Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:


Please see the attached test_EdgeToEdgeDataList2.html. In the data source, onClick handler is defined for each list item. Open the test page and click each item, you'll find that blue background color is not applied (e.g. item not marked as clicked). However, if you remove the onClick hander in data souce, you'll find the blue background color will be applied after clicking. The root cause is that the onClick() handler defined in data source overwrites the original one.

The defined one should not overwrite the original one, instead it should be connected to the original one. A good example is how EdgeToEdgeList? handle onClick handler defined in template HTML. Please see test_EdgeToEdgeList-check2.html. Each time you click the list item, both the original handler and the specified handler are invoked.

Attachments (2)

test_EdgeToEdgeDataList2.html (2.0 KB) - added by Ming Zhe Huang 11 years ago.
test case
test_EdgeToEdgeList-check2.html (2.6 KB) - added by Ming Zhe Huang 11 years ago.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Ming Zhe Huang

test case

Changed 11 years ago by Ming Zhe Huang


comment:1 Changed 11 years ago by ykami

It is your application that overrides the default onClick handler. I don't think it is a good idea in the first place. How about handling onclick events from a list widget, not from each list item? You should be able to reach the clicked item.

comment:2 Changed 11 years ago by ykami

Resolution: invalid
Status: newclosed

Please take a different approach.

Note: See TracTickets for help on using tickets.