I am using a template for the edit popup. I am trying to force the grid to go into edit mode and show the edit template popup when a link within one of the columns is clicked.
I tried using a command but I am unable to data bind the hyperlink’s text to a field declared in the model, in this case to ‘CourseType’. Is data binding supported within command columns?
columns: [
{
command: [
{
id: "edit",
title: "School Item",
template: '<a href="\\#">#=CourseType#</a>',
width: 120
}
]
}
]
If data binding is not supported within a command column, then how do I put the grid into edit mode when the templated field is clicked?
columns: [
{
field: "CourseType",
title: "School Item",
template: '<a href="\\#">#=CourseType#</a>'
}
]
I’m not sure why do you want to define the cell as an HTML
anchorbut there is no problem on making it enter on popup edit mode when clicking on the anchor.1) Add to your template a
classthat would allow us to find those cells. Something like:where I have include
class="ob-edit-popup"to the template.2) add to your grid definition the option
editable: "popup".3) add the following JavaScript code after the initialization.
Where
gridis the result of: