Currently I have a Kendo Grid with multi selectable rows. My Problem is i cannot select text from any columns because of the Drag Row Selecting feature of Kendo. is there Any way to disable the Drag Row Selecting in Kendo Grid?
Thank you very much
I know this is an old question, but the best answer I could find to this problem was over on the telerik forums
I adapted an angular version of the solution, which additionally calls the grids change callback.
.directive('kendoGrid', ['$', '$parse',
function($parse) {
return {
link: function(scope, element, attrs) {
if (attrs.multiselect !== undefined) {
attrs.kSelectable = '""';
var selectedClass = 'k-state-selected';
var fn = $parse(attrs.kOnChange);
$(element).delegate('tbody tr', 'click', function(e) {
e.preventDefault();
if (e.ctrlKey || e.metaKey) {
$(this).toggleClass(selectedClass);
} else {
$(this).addClass(selectedClass).siblings().removeClass(selectedClass);
}
var grid = $(element).data('kendoGrid');
if (fn) {
scope.$apply(function() {
fn(scope, {
kendoEvent: {
sender: grid
}
});
});
}
});
scope.$on(
'$destroy',
function() {
$(element).undelegate('tbody tr', 'click');
}
);
}
}
};
}
])
As per the comment on the forum, the traditional grid.select() call no longer works as it requires a selection model.
var grid = kendoEvent.sender;
var selectedRows = grid.tbody.find(".k-state-selected"); //grid.select();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With