jamil isayyed
jamil isayyed

Reputation: 11

EXTJS 4.1 , listeners for events on grid row body tpl

Currently I am facing a problem in extjs, which is I have a grid with the feature rowbody. In this rowbody feature I render a tpl.

This tpl is as follow:

.
.
.
'<tpl for="datalist">' + 
  <b>{name}</b>: </tpl>
   <span class="test"><em class="test1">{number}</em></span>' + 
'</tpl>
.
.
.

When a user open the rowbody there is another data and a part of it is that what I am showing, there will be a list like this:

data list: 111111,2222,3333.....

I need when a user click on one of those numbers to get the dom element get the number and fire a special event, so how can I do this, without using dataview? I already implemented it in dataview, but it is important to have it inside rowbody feature.

Please do not hesitate in asking for any other information... I hope that this enough and you can help me.

Upvotes: 1

Views: 1220

Answers (1)

cronusdracon
cronusdracon

Reputation: 36

You could add a javascript onclick event inside of the template.

   <tpl for="datalist">' + <b><a href=# onclick=alertName("{name}")>{name}</a></b>

function alertName(name){
    alert(name);
}

Upvotes: 1

Related Questions