javascript - Add hyperlink with click event to Dojo grid -


my question similar implementing hyperlink within dojo datagrid, , i'm able add markup hyperlinks dojo grid using formatter.

however, need wire click events on these hyperlinks, trigger function within dijit containing grid.

i have formatter following:

var createeditlinks = function (data) {    return '<a class="my-css-class" href="#" onclick="myfunctioninsidethedijit()">' + data.title + '</a>' } 

while works (i markup inside grid cell), myfunctioninsidethedijit function unavailable (unless declare on global scope).

i've looked little @ dom-construct, can't figure out how add hyperlink invokes dijit function when clicked.

any appreciated! thanks!

a more modern way dojo.behavior use on , event delegation. dgrid instances expose own on function make easier:

grid.on('a.my-css-class:click', function (event) {     ... }); 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -