Hello All,
I am working with the New Kendo UI Web Controls and so far they have been fairly easy to integrate into my existing application. I know Kendo UI is new and there are a bunch of things in the works but I was curious if there was a way to make a custom command.
My Grid Golumns are set up as follows
columns: [
{ field: "subcatid", width: 90, title: "Subcatagory" },
{ field: "title", width: 90, title: "Title" },
{ field: "order", width: 90, title: "Order" },
{ field: "author", width: 90, title: "author" },
{ field: "lastupdate", width: 90, title: "Last Update" },
{ field: "usecms", width: 90, title: "Use Update" },
{ field: "alturl", width: 90, title: "Alt URL" },
{ field: "active", width: 90, title: "Active" },
{ command: ["edit", "destroy", "View"], title: " ", width: 90 }
],
Doing this creates a new Button with the Commands called "View" I would like this button to redirect to a page when clicked. I am using the following bits of JQuery to call the function, however I would much rather add a class descriptor to this button that is unique to View Commands to replace the selector with $('.k-grid-view') Is there an easy way to do this?
$('td .k-button:last').live('click', function ()
{
var itemToView;
var grid = $("#grid").data("kendoGrid");
var gridData = grid._data;
var uid = $(this).parent().parent().attr('data-uid');
$(gridData).each(function () {
var item = this;
if (item.uid == uid.toString())
itemToView = this;
});
window.location.replace(itemToView.view);
});
ps view is not a column but exists in the model
Thanks
- Josh
I am working with the New Kendo UI Web Controls and so far they have been fairly easy to integrate into my existing application. I know Kendo UI is new and there are a bunch of things in the works but I was curious if there was a way to make a custom command.
My Grid Golumns are set up as follows
columns: [
{ field: "subcatid", width: 90, title: "Subcatagory" },
{ field: "title", width: 90, title: "Title" },
{ field: "order", width: 90, title: "Order" },
{ field: "author", width: 90, title: "author" },
{ field: "lastupdate", width: 90, title: "Last Update" },
{ field: "usecms", width: 90, title: "Use Update" },
{ field: "alturl", width: 90, title: "Alt URL" },
{ field: "active", width: 90, title: "Active" },
{ command: ["edit", "destroy", "View"], title: " ", width: 90 }
],
Doing this creates a new Button with the Commands called "View" I would like this button to redirect to a page when clicked. I am using the following bits of JQuery to call the function, however I would much rather add a class descriptor to this button that is unique to View Commands to replace the selector with $('.k-grid-view') Is there an easy way to do this?
$('td .k-button:last').live('click', function ()
{
var itemToView;
var grid = $("#grid").data("kendoGrid");
var gridData = grid._data;
var uid = $(this).parent().parent().attr('data-uid');
$(gridData).each(function () {
var item = this;
if (item.uid == uid.toString())
itemToView = this;
});
window.location.replace(itemToView.view);
});
ps view is not a column but exists in the model
Thanks
- Josh