Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to track index on Custom Listview Cell when we click on inside Button (QML)
    primarykey
    data
    text
    <p>I am form iOS background so i will give example of UITableView in iOS. </p> <p>in table view when we create custom Cell for our application then we get the child view by putting "TAG" on each view including buttons . and it becomes easy to get the "INDEX OF ROW" by clicking on any UIButton.</p> <p>mean suppose we have a custom list which include many labels, images and button. we can track the specific Cell by clicking on label and images but when we click on Button it does not give us index of that cell until we use some technique to handle this and mostly programmers use tagging to track the view inside cell .</p> <p>Now my Question is "SAME I WANT TO DO WITH BLACKBERRY 10 LISTVIEW" .</p> <p>In my situation i have a list view and on click it opens the specific View related to that cell. every thing is working fine when i click on cell every where except Button .</p> <p>How can i track the index of that Cell on clicking the button. because using index i have to pick value from dataModel .</p> <p>Please let me know if i am able to tell my problem</p> <blockquote> <p>Edits:</p> </blockquote> <p>This is my Code</p> <p>I define my list view as</p> <pre><code> ListView { translationY: 130 dataModel: dataModelList listItemComponents: [ ListItemComponent { type: "item" Chekdata { } } ] onTriggered: { var showDetail = productDetailPageID.createObject(); showDetail.myProfileData=dataModel.data(indexPath); navigationPane.push(showDetail); console.log(dataModel.data(indexPath)["cat_name"]); } } </code></pre> <p>where Chekdata.qml is like this</p> <pre><code>import bb.cascades 1.0 import org.labsquare 1.0 Container { preferredHeight: 600 preferredWidth: 768 layout: AbsoluteLayout { } WebImageView { id: img url: ListItemData.offer_image preferredWidth: 610 translationY: 70.0 translationX: 70.0 preferredHeight: 250 } Label { text:ListItemData.member_id translationY: 320.0 translationX: 70.0 } Label { text: ListItemData.offer_type translationX: 70 translationY: 350 } Label { text: "Category:" translationY: 400 translationX: 70 textStyle.fontSize: FontSize.XSmall } Label { text: ListItemData.cat_name translationY: 400 translationX: 210 textStyle.fontSize: FontSize.XSmall } Label { text: "Offer Added Date:" translationY: 440 translationX: 70 textStyle.fontSize: FontSize.XXSmall } Label { text: ListItemData.date_start translationY: 440 translationX: 250 textStyle.fontSize: FontSize.XXSmall } Label { text: ListItemData.discount translationY: 480 translationX: 70 } Label { text: "coupon Left :" translationX: 400 translationY: 320 textStyle.fontSize: FontSize.XSmall } Label { text: ListItemData.coupon_code translationX: 570 translationY: 325 textStyle.fontSize: FontSize.XXSmall } Label { text: "Location:" translationX: 400 translationY: 360 textStyle.fontSize: FontSize.XSmall } Label { text: ListItemData.location translationX: 520 translationY: 360 textStyle.fontSize: FontSize.XSmall } Label { text: "offer Expires :" translationX: 400 translationY: 400 textStyle.fontSize: FontSize.XXSmall } Label { text: ListItemData.date_end translationX: 540 translationY: 400 textStyle.fontSize: FontSize.XXSmall } ImageButton { defaultImageSource: "asset:///images/BlueNoseBig.png" preferredHeight: 60 preferredWidth: 150 translationX: 500 translationY: 470.0 } } </code></pre> <p>There are main Three elements Webimageview, label, and ImageButton. and you can see on above code the onTrigger function. this function is not call when i click on ImageButton</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload