Hi
Trying to
make a grid containing a button column, where the button displays a locked or
unlocked button icon depending on the data source for the row. The button
should also toggle the locked property.
Using a “normal”
column template it is simple to make the visual part of the task.
{ field:
"Locked"
,
title:
""
, width: 20, template: '<div
class=
"btn btn-default"
> <i class=
"#= Locked? "
fa
fa-lock
" : "
fa fa-unlock
" # "
></i></div>',
filterable:
false
},
The above code works but does not handle click event.
Using a command field template, the field variables are not available?
{ command:
{ click: toggleLocked,
template:
'<div class="btn btn-default"> <i class="#=Last? "fa fa-lock" : "fa fa-unlock" #"></i></div>'
},
width: 20
},
The above code does not work.
Any suggestions?