I have the base functionality of D&D working just fine. What I need to know is how to bind the behavior to dynamically created elements. I've found no reference in the documentation to allow the draggable event to bubble up to the newly created element. I don't want to have to unbind and rebind the kendoDraggable every time I create an element. Here's an example of what I'm trying to do:
https://dojo.telerik.com/OxUJE
Thanks
hi,
Need your help.
I have a problem with kendoSortable and tabStrip.
when the direction in the page is right to left it does not work correctly.
I'm using your demo of kendoSortable with tabStrip from:
http://demos.telerik.com/kendo-ui/sortable/integration-tabstrip
just add to the body dir="rtl"
thanks
If I remove the url property on the data item, behavior is normal.
I've got a jsFiddle that demonstrates the problem here. The last node, 'Carpets' has a url property and can't be dropped and won't fire the drag event.
Hello,
I have a quite complex drag&drop scenario:
After some testing I found a solution which works quite good. But strangely just when I load the test application from a local test web server.
If I install the application on a remote Web Server the identification of the grid row where the drop occured fails. I stripped down everything
which does not belong to that problem (for example angularjs to have the same behaviour jQuery based). Here is the reduced code. To even
exclude the possibility that it could have to do something with my eval version of kendo I used the libraries from CDN.
Can be tested here: http://medialan.de:9800/dragdroptest.html
On dojo the code is working!
<!DOCTYPE html>
<html>
<head>
<link href="../kendo/styles/kendo.common.min.css" rel="stylesheet" />
<link href="../kendo/styles/kendo.rtl.min.css" rel="stylesheet" type="text/css" />
<link href="../kendo/styles/kendo.default.min.css" rel="stylesheet" />
<link href="../kendo/styles/kendo.default.mobile.min.css" rel="stylesheet" type="text/css" />
<script src="../kendo/js/jquery.min.js"></script>
<script src="../kendo/js/kendo.all.min.js"></script>
<script>
$(function() {
var d = [
{ v : "a" },
{ v : "b" },
{ v : "c" }];
var grid = $('#grid').kendoGrid({
dataSource: new kendo.data.DataSource({ data: d }),
selectable : "row",
columns: [ { field: "v" } ]
}).data('kendoGrid');
grid.table.kendoDropTarget({
drop: function(e) {
e.draggable.hint.hide();
// dropuid is undefined, when providing the test from a remote server
// - e.target is div.k-grid.k-widget when using remote server
// - e.target is td when using a local server
var dropuid = $($(e.target).parent()).data("uid");
console.log('dropuid is: ' + dropuid);
dropuid = grid.dataItem(e.target.closest("tr")).uid;
console.log('dropuid is: ' + dropuid);
}
});
grid.table.kendoDraggable({
filter: "tbody > tr",
cursorOffset : { top: 1, left: 1},
hint: function(e) {
return $('<div class="k-grid k-widget"><table><tbody><tr>' + e.html() + '</tr></tbody></table></div>');
}
});
});
</script>
</head>
<body>
<div id="grid"></div>
</body>
</html>
Hi,
I am trying to implement Multi select items drag and drop from 1 listview to another.
I know that both selectable and draggable listen to the same event Select, hence directly we cannot do. Can someone help with some work around?
Here is my working code for single selection drag and drop: I want to make it work for selecting multiple drag and drop.
var
dataSourceSalesRole =
new
kendo.data.DataSource({
data: salesRole,
pageSize: 21
});
var
dataSourceSalesRoleContainer =
new
kendo.data.DataSource({
data: salesRoleContainer,
pageSize: 21
});
$(
"#listViewSalesRole"
).kendoListView({
dataSource: dataSourceSalesRole,
template: kendo.template($(
"#templateSalesRole"
).html())
});
$(
"#listViewSalesRoleContainer"
).kendoListView({
dataSource: dataSourceSalesRoleContainer,
template: kendo.template($(
"#templateSalesRoleContainer"
).html())
});
$(
"#listViewSalesRole"
).kendoDraggable({
group:
"salesRole"
,
filter:
".move"
,
hint:
function
(element) {
return
element.clone();
}
});
$(
"#listViewSalesRoleContainer"
).kendoDropTarget({
group:
"salesRole"
,
dragenter:
function
(e) {
e.draggable.hint.css(
"opacity"
, 0.6);
},
dragleave:
function
(e) {
e.draggable.hint.css(
"opacity"
, 1);
},
drop:
function
(e) {
var
count = 0;
var
dropItem = dataSourceSalesRole.getByUid(e.draggable.hint.data().uid);
var
salesRoleId = dropItem.SalesRoleId;
var
saleRoleContainerData = dataSourceSalesRoleContainer.data();
$(saleRoleContainerData).each(
function
() {
if
(
this
.SalesRoleId == salesRoleId) {
alert(
'Sales Role already exist! Cannot add.'
);
count++;
}
});
if
(count == 0) {
dataSourceSalesRoleContainer.add(dropItem);
dataSourceSalesRole.remove(dropItem);
}
}
});
I'm trying to configure a DnD from a TreeList view onto custom sidebar. I'm using Angular 1.x, and the the sidebar is configured as a directive complete with its own scope.
Is there a recommended way to transfer the data model that's tied to the treelist row to and from this sidebar given they are separate in scope?
Looking as many of the demos, it was difficult for me to determine how exactly to apply those techniques to my scenario.
Using AngularJS I have a grid that I can drag the header from and place into an input field.
What I would like to do is drag and place this header in the same fashion that DataTransfer.setData() works, this will allow me to keep adding information to the input field in whichever order I would like.
Here is a plunker with an example of what I am trying to achieve though some reason the kendo header won't populate the input in plunker but it does work on my local project.
Thanks, any help on this would be great as I really want to use the kendo grid for this