Reputation: 1045
I have a grid,with one column,every time i look for something using a text box i have,this one column grid shows a list of items which i should be able to click on each item ,means make them clickable,i know i can put button there but i want the i item clickable,any suggestion?
$("#TurbineType").click(function () { var drp = document.getElementById('autocomplete').value;
$.ajax({
dataType: "json",
type: "POST",
url: "@Url.Action("turbineTypeList","AdminTool")",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ "turbineName": drp, }),
success: function (result) {
$("#turbingrid_Device").kendoGrid({
dataSource: result,
//editable: "inline",
//editable: true,
//height: 'auto',
scrollable: true,
//toolbar: ["save", "cancel"],
//sortable: { mode: "single", allowUnsort: true },
columns: [
{ field: 'Text', title: 'DeviceType', width: '100px' },
{ command: { text: "View Details"}, title: " ", width: "50px" }
]
});
}
})
});
Upvotes: 1
Views: 3542
Reputation: 2307
You can use:
$("#grid").on("click", "td", function(e) {
});
in order to subscribe to a click event on grid cells once the grid has been initialized.
After clearing up the question in the comment below, you can display column values as hyperlinks by using the column template
and href
, like follows:
columns: [{ field: "URL", title: "URL", template: '<a href="\\#">#=Title#</a>'}]
Here is another Dojo example to demonstrate.
Upvotes: 3