Results 1 to 4 of 4

Thread: [SOLVED] Dataview display some image - on event click how to know which image ?

  1. #1

    Default [SOLVED] Dataview display some image - on event click how to know which image ?

    Hy all.

    Here is my requierement.
    I have a store and I display its content throw a dataview.
    My dataview display some element as the name, creation date... retrieved from each records.
    Under those information, I want to display some icons for custom action like delete, download, order, modify....
    I display thos icons with the template.
    But now, when I click on one of those icons, how can I know which one is clicked during the event ?

    Regards
    AMEXIO (http://www.amexio.fr/) - Partenaire Alfresco

    http://www.infoged.fr pour suivre l'actualit

  2. #2

    Default [SOLVED] Dataview display some image - on event click how to know which image ?

    OK, sorry stupid question...

    Using getTarget from the event object does exactly what I wanted....
    Last edited by Etienne Jouvin; 21 Nov 2008 at 4:07 AM. Reason: change title
    AMEXIO (http://www.amexio.fr/) - Partenaire Alfresco

    http://www.infoged.fr pour suivre l'actualit

  3. #3
    Sencha User
    Join Date
    Oct 2010
    Location
    philippines
    Posts
    26

    Default how to get the selected image in dataview

    hi,

    Where you able to get the selected image?

    Can you post your code?
    I'm a web developer/software engineer and a business coach who helps those new to online marketing or who are in direct sales generate a steady flow of fabulous leads using on-line business tools. I love helping people generate more sales & income without having to experience rejection & frustration.

    http://edwindeloso.com

  4. #4

    Default

    Use the getTarget on the event.
    Guess the event is in var event, the following code, check the node under the event is a img, and get the node attribute "action" value:


    var eventTarget = event.getTarget();
    var action;
    if (eventTarget && "IMG"==eventTarget.tagName.toUpperCase()) {
    var actionAttr = eventTarget.getAttributeNode("action");
    if (actionAttr) {
    action = actionAttr.nodeValue;
    }
    }
    Last edited by Etienne Jouvin; 7 Feb 2011 at 4:48 AM. Reason: Formatting
    AMEXIO (http://www.amexio.fr/) - Partenaire Alfresco

    http://www.infoged.fr pour suivre l'actualit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •