Telerik MVC Grid - Enable editing clientside
I know this is a rather specific question - but I wasn't able to find any help in the Telerik MVC Grid documentation开发者_C百科.
I was wondering if anyone was aware of a way to trigger a grid into "edit mode" via a client-side event. I was having issues with the toolbar and thought this might be possible through jQuery / JavaScript.
$('#addName').click(function () {
var grid = $("#NamesGrid").data("tGrid");
//Enable Editing here?
return grid;
});
I am using server-side binding - so hitting a Controller action wouldn't really be an issue, if I had to do a .post
or something like that.
Thanks
After a bit of exploring through source - you can accomplish this by adding the following:
$('#addName').click(function ()
{
window.location = "[ControllerAction]?[NamesGrid]-mode=insert";
});
Obviously this example was for a grid inside of a popup window - but hopefully this could help others if they ran into similar issues.
精彩评论