Telerik Forums
Kendo UI for jQuery Forum
1 answer
245 views

I am trying to disable the drag/drop within the treeview (as in the user wont be able to move any items anywhere inside the treeview). However I am not coming up with a solution for this issue.

I still want the user to be able to drag/drop an item that's inside the treeview over to my listview box as well as drag/drop it back to the treeview box.

So is it possible to disable the drag/drop feature inside the treeview when keeping the drag/drop from there to my listbox?

Neli
Telerik team
 answered on 28 Jul 2021
0 answers
185 views

 

Please see the image marked. Looking for the same functionality at the parent element.

Unnikrishnan
Top achievements
Rank 1
 asked on 23 Jul 2021
0 answers
441 views

Hi ,

            Attached is a version of JavaScript we use to bind dynamic data to kendo grid with dynamic columns and server side grouping enabled. (As seen in the logic, we use a group column to group and ungroup column to ungroup on a field.)

I am looking forward for implementing the below. Please provide a sample version of the modified js file and/or links to appropriate client side events that can support these in a logical order.

1. How to disable the default behavior of drag and drop on grouping , but still show the grouping grey bar above the grid? 

I tried the below but it is not working(can't find the equivalent draggable event for group)

https://docs.telerik.com/kendo-ui/controls/interactivity/draganddrop/how-to/disable-dragging-runtime

2. Provide a “clear groups” button in the grouping bar and upon clicking that button, clear all groups. (Please note that the “clear groups“ button to be shown, only when at least one group is enabled.

3. Show the Grouping  grey bar if you group by at least one column and hide the grey bar, if there are no columns to group by. Please confirm if the logic implemented in the attached file to hide and show the grouping grey bar is the correct approach.

Thanks,

Aravind
Top achievements
Rank 1
 asked on 30 Jun 2021
1 answer
834 views

Hi,

I need to select multiple rows in a kendo grid and  move them inside the grid to reorder them.

I'm using kendoSortable


grid.table.kendoSortable({ filter: ">tbody >tr", hint: function (element) { //customize the hintvar table = $( '<table style="width: 600px;" class="k-grid k-widget"></table>' ), hint; table.append(grid.select().clone()); //append the dragged element table.css("opacity", 0.7); return table; //return the hint element }, cursor: "move", placeholder: function (element) { return $('<tr colspan="4" class="placeholder"><td colspan ="' + grid.columns.length + '">Drop here</td></tr>'); }, change: function (e) { console.log(grid) var selectedId = []; grid.select().each(function(){ selectedId.push(this.getElementsByClassName('idCompOperation')[0].innerText); }); // do some stuff } });

 

In the change function I can get the multiple elements selected and change the order of them in the datasource but visually only the first column selected is moved in the table iven if I refresh the grid

 

Select 2 rows:

Drag to the beginning of the table

 

Just the first of the 2 rows is moved the other remains at the bottom

 

How can I do?

Thanks Mik

Neli
Telerik team
 answered on 23 Jun 2021
1 answer
77 views

Hello,

I have treelists with two levels of items (titles and positions). The titles can be rearranged via drag&drop. Dragging a title onto another title changes the order of titles. Positions can both be dragged under the same title but also to an other title.

Examples:

  • Dragging title 4 onto title 2 makes title 4 the new title 2, title 2 becomes title 3 and title 3 becomes title 4. All subitems (positions) stay with their titles.
  • Dragging position 4 in title 3 (3.4) onto position 2 in title 3 (3.2) makes 4 the new 2 (3.2), 2 the new 3 (3.3) and 3 the new 4 (3.4).
  • Dragging position 4 in title 3 (3.4) onto position 2 in title 2 (2.2) makes 4 the new 2 in title 2 (2.2), 2 in title 2 the new 3 in title 2 (2.3) and position 5 in title 3 (3.5) the new position 4 in title 3 (3.4).

To do this (see code in attachment) I manipulate the title field and the parentId of the datasource. This worked fine as long as I dirctly saved items that were added to the list. But now I have to use batch save.

Now when I add a new title to the list and add or rearrange positions to that title or rearrange titles via drag&drop before saving the affectet titles and positions are attached to wrong parent items, sometimes items get duplicated. Doing the same thing after saving works as intended.

I assume the reason for this is that new items have an Id of 0 before saving.

I see that it is possible to rearrange items in treelists via drag & drop in your demos without manipulating these fields manually. But I don't see how can do this and get the same results as in the examples above. Could you please help me figure this out?

Note: in the attached files I have included sampledata as local data. In the project we bind to remote data. Not sure if this affects the beavior

Georgi Denchev
Telerik team
 answered on 18 Jun 2021
1 answer
228 views

Is there a way to remove copy and only confirm Move when dragging and dropping a file?

I tried manipulating options.messages.dialogs.moveConfirm to show only move, but I still have a small button for Copy


filemanager.options.messages.dialogs.moveConfirm.content = '<p style="text-align: center;">Do you want to move file?</p>';
filemanager.options.messages.dialogs.moveConfirm.okText = '';

Martin
Telerik team
 answered on 14 Jun 2021
1 answer
54 views

Can we use draggable inside touchable?

So we can drag and drop the element with double click.

Thank you in advance

Petar
Telerik team
 answered on 28 Jul 2020
4 answers
320 views

Trying to figure out how to stop a move of Outlook Email during drag and drop. I have tested in your sample code in the Dojo it is also happening there. 

So what is happening is you drag and drop a email, which does work, but instead of making a copy and uploading that it pulls the email out of outlook completely. At first I thought this was a bug in outlook but I tried using the drag and drops of other sites using different browsers and they would not pull the email out of outlook. So I think it is an issue with Kendo UI drag and drop upload. Is this a known bug? Is there a workaround to fix this issue?

Josh
Top achievements
Rank 1
 answered on 08 Apr 2020
1 answer
57 views

Following on from my previous posts (here and here)

My scheduler has a timeline view where the user can specify his start and end times according to which shift they are on. The choices are Early (08:00 - 14:00), Late (14:00 - 22:00), Nights (22:00 - 06:00) or full day (00:00 to 23:59). I have discovered that the code in the linked posts will only work if the view is full day.

In order to try and figure out what is causing this I placed some console.log lines as so:

//Make the scheduler a drop area for drag and drop.
    function createDropArea(scheduler) {
 
        var grid = $("#grid").data("kendoGrid");
 
        scheduler.view().content.kendoDropTargetArea({
            filter: ".k-scheduler-table td, .k-event",
            drop: function (e) {
 
                var offset = $(e.dropTarget).offset();
                console.log('drop target: %0', $(e.dropTarget));
                var slot = scheduler.slotByPosition(offset.left, offset.top);
                console.log('slot startDate: ' + slot.startDate);
                console.log('slot start time: ' + slot.startDate.getTime());
                var slotResource = scheduler.resourcesBySlot(scheduler.slotByElement($(e.dropTarget)));
                console.log('slotResource: %0', slotResource.assignee);
                var dataItem = grid.dataItem(grid.select());
                var eventStart = slot.startDate;
                var eventEnd = new Date(slot.startDate.getTime() + (dataItem.end - dataItem.start));
                console.log('event start time: ' + eventStart);
                console.log('event end time  : ' + eventEnd);
 
                if (dataItem && slot) {
                    var offsetMiliseconds = new Date().getTimezoneOffset() * 60000;
                    var newEvent = {
                        eID: -1,
                        eClonedID: 0,
                        status: dataItem.status,
                        assignee: slotResource.assignee,
                        title: dataItem.title,
                        start: eventStart,
                        end: eventEnd,
                        requestType: dataItem.requestType,
                        lastUpdatedBy: $UserID,
                        isEvRecurring: dataItem.isEvRecurring,
                        isAllDay: dataItem.isAllDay,
                        startTimezone: dataItem.startTimezone,
                        endTimezone: dataItem.endTimezone,
                        clearNotes: dataItem.clearNotes,
                        resetToPlanned: dataItem.resetToPlanned,
                        replicateRecurrence: dataItem.replicateRecurrence,
                        moveDiff: dataItem.moveDiff,
                        deleteRecurring: dataItem.deleteRecurring
                    };
 
                    scheduler.dataSource.add(newEvent);
 
                    //clear selected row so that we don't have the issue of
                    //selected items being added when we are cloning or moving events.
                    grid.clearSelection();
                }
 
            }
        });
    }

 

When the scheduler that shows the full day and I drag & drop onto the 09:00 slot the console outputs....

drop target: %0 jQuery.fn.init [td..k-nonwork-hour]
TEST:2089 slot startDate: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2090 slot start time: 1574758800000
TEST:2092 slotResource: %0 138
TEST:2096 event start time: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2097 event end time  : Tue Nov 26 2019 10:30:00 GMT+0000 (Greenwich Mean Time)

This will render the event correctly.

When the scheduler is showing just 06:00 to 14:00 and I drag & drop onto the 09:00 slot the console outputs....

drop target: %0 jQuery.fn.init [td]
TEST:2089 slot startDate: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2090 slot start time: 1574758800000
TEST:2092 slotResource: %0 138
TEST:2096 event start time: Tue Nov 26 2019 09:00:00 GMT+0000 (Greenwich Mean Time)
TEST:2097 event end time  : Tue Nov 26 2019 10:30:00 GMT+0000 (Greenwich Mean Time)

Here the event is not rendered at all.

The only difference I can see is the drop target. On the one that works we have drop target: %0 jQuery.fn.init [td..k-nonwork-hour] while on the one that does not we have drop target: %0 jQuery.fn.init [td]

Totally lost on this one... any help appreciated.

 

Ivan Danchev
Telerik team
 answered on 29 Nov 2019
1 answer
424 views

Hi,

Following on from a previous post

I now have a grid view as the source for my drag items and dropping onto a scheduler and this works great when the scheduler is configured to show one resource. If the scheduler has a resource group I would like to not only pick the timeslot where the item was dropped but also the resource too.

My scheduler Resources are defined as:

var resourcesParam = '?d=' + String($kk_sDivisionFk) + '&t=' + String($kk_sTeamFk) + '&a=' + String($kk_sAssignee) + '&u=' + String($UserID);
        var schedulerResources = [
            {
                field: "assignee",
                name: "Assignee",
                dataTextField: "Text",
                dataValueField: "Value",
                dataSource: {
                    transport: {
                        read: {
                            url: '@Url.Content("~/Home/GetActiveMembers")' + resourcesParam,
                            dataType: 'json'
                        }
                    }
                },
                title: "Assignee"
            }
        ];

 

Based on the previous post... my create drag area is set as:

//Make the scheduler a drop area for drag and drop.
function createDropArea(scheduler) {
 
    var grid = $("#grid").data("kendoGrid"),
    gridRowOffset = grid.tbody.find("tr:first").offset();
 
    scheduler.view().content.kendoDropTargetArea({
        filter: ".k-scheduler-table td, .k-event",
        drop: function (e) {
 
            var offset = $(e.dropTarget).offset();
            var slot = scheduler.slotByPosition(offset.left, offset.top);
            var dataItem = grid.dataItem(grid.select());
 
            if (dataItem && slot) {
                var offsetMiliseconds = new Date().getTimezoneOffset() * 60000;
                var newEvent = {
                    eID: -1,
                    status: dataItem.status,
                    assignee: XXXXX, //This should be the dataValueField from schedulerResources above (it is an integer)
                    title: dataItem.title,
                    start: slot.startDate,
                    end: new Date(slot.startDate.getTime() + (dataItem.end - dataItem.start)),
                    requestType: dataItem.requestType,
                    lastUpdatedBy: currentUser,
                    isAllDay: dataItem.isAllDay,
                    startTimezone: dataItem.startTimezone,
                    endTimezone: dataItem.endTimezone
                };
 
                //grid.dataSource.remove(dataItem); //I don't need to remove item from grid.
                scheduler.dataSource.add(newEvent);
            }
 
        }
    });
}

 

Is there a way to get the assignee value? If it helps the scheduler has been restricted to timeline, timelineWeek and timelineMonth views.

Thanks.

 

 

 

MiDAS
Top achievements
Rank 1
Iron
Iron
 answered on 22 Nov 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?