Telerik Forums
Kendo UI for jQuery Forum
1 answer
217 views

I have two sortable divs, configured to allow me to drag element from div A to div B. Working great. The only thing is, my element disappears from div A when I drag it to div B. How can I prevent the element from being removed from div A?

Thanks in advance!

 

For reference, below is my code instantiating the sortables:

$("#leftSide").kendoSortable({
    cursor: "move",
    connectWith: "#rightSide",
    placeholder: placeholder,
    hint: hint
});
 
$("#rightSide").kendoSortable({
    cursor: "move",
    placeholder: placeholder,
    hint: hint,
    start: function (e) {
        if (isResizing) {
            e.preventDefault();
        }
    },
    change: function (element, ui) {
        element.item.height(90);
        var myWidth = element.item.width();
        element.item.width(myWidth - 10);
    }
});
Stefan
Telerik team
 answered on 15 Dec 2016
5 answers
251 views
I am trying to add row reordering functionality inkendoTreeList using kendoSortable using following code.

                var grid =$('#scorecardTreeList').kendoTreeList({
                    dataSource: treedataSource,
                    columns: [
                        { field: "strategicName", title: "Strategic Name" },
                        { field: "Type", title: "Type" },
                        { field: "Name", title: "Name" }
                    ],
                    selectable: true,
                    expanded: true
                }).data("kendoTreeList");

                $($('#scorecardTreeList table')[1]).kendoSortable({
                    filter: ">tbody >tr",
                    hint: $.noop,
                    cursor: "move",
                    placeholder: function(element) {
                        return element.clone().addClass("k-state-hover").css("opacity", 0.65);
                    },
                    container: "#scorecardTreeList tbody",
                    change: function(e) {
                        var skip =0,
                            oldIndex = e.oldIndex + skip,
                            newIndex = e.newIndex + skip,
                            data = treedataSource.data(),
                            dataItem = treedataSource.getByUid(e.item.data("uid"));
                        grid.dataSource.remove(dataItem);
                        grid.dataSource.insert(newIndex, dataItem);
                    }
                });

I am facing issue that the row next to desired row (which i want to move) appears below dragged row after reordering.
e.g if I have following rows
Tiger
Apple
Meow
Orange
ABC1

when I move Tiger below Orange the new order appears as 

Meow
Orange
Tiger
Apple
ABC1 which is unexpected.

Please help.

Alexander Valchev
Telerik team
 answered on 13 Dec 2016
1 answer
150 views

I've got two kendo sortable list wherein I can drag the multi-selected items left to right. All looks good but I experienced this weird behavior. The second time I drag diagonally upwards (north east), the placeholder "Drop here" will not appear until you move the mouse downward a little.
Start dragging "Strawberries" then "Pinapples" to the right list. Remember that your cursor should move north east until you reach the below of "Strawberries"
Is this a limitation of kendo drag and drop?

Here is the Dojo that I am using.

Stefan
Telerik team
 answered on 09 Dec 2016
2 answers
210 views

So I edited a dojo example to cause the behavior. The selections / ignores work fin in the code provided. Once you turn on the handle options to different handles even you no longer can select the items in the sub lists. Any ideas? Thanks in advance. 
-Todd

<html>
<head>
    <meta charset="utf-8" />
    <title>Kendo UI Snippet</title>
 
 
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<body>
 
    <ul id="parent">
        <li class="list-item"><span class="handler"></span><div><label>Apples</label></div></li>
        <li class="list-item"><span class="handler"></span><div><label>Grapefruits</label></div></li>
        <li class="list-item">
            <span class="handler"></span><div>
                <label>group</label>
                <ul class="nested">
                    <li class="sub-list-item">
                    <span class="subhandler"></span>Cranberries</li>
                    <li class="sub-list-item"><span class="subhandler"></span>Pineapples</li>
                    <li class="sub-list-item"><span class="subhandler"></span>Strawberries</li>
                </ul>
            </div>
        </li>
        <li class="list-item">
            <span class="handler"></span>group2
            <ul class="nested">
                <li class="sub-list-item"><div><span class="subhandler"></span>Cranberries</div></li>
                <li class="sub-list-item"><span class="subhandler"></span>Pineapples</li>
                <li class="sub-list-item"><span class="subhandler"></span>Strawberries</li>
            </ul>
        </li>
    </ul>
    <style>
        .handler {
            width: 16px;
            height: 16px;
            background-color: #FF0000;
            display: inline-block;
        }
 
        .subhandler {
            width: 16px;
            height: 16px;
            background-color: #FFFF00;
            display: inline-block;
        }
    </style>
    <script>
    function placeholder(element) {
      return $("<li style='color: red;' class='list-item' id='placeholder'>Drop Here!</li>");
    }
 
    $("#parent").kendoSortable({
      filter: ">li.list-item",
      //handler: '.handler', //Uncomment this line
      ignore: ".nested>li", //ignore nested list-items
      placeholder: placeholder
    });
    $(".nested").kendoSortable({
      //handler: '.subhandler', //And uncomment this line and the sorting will no longer work...
      filter: ".sub-list-item",
      placeholder: placeholder
    });
    </script>
</body>
</html>

 

Alexander Valchev
Telerik team
 answered on 03 Oct 2016
1 answer
26 views

HI,

When I am trying to sort list view using kendo sortable drag & drop, list item hangs in between and stays there itself on the page and it is visible through out app in all views even if I leave the page where text hangs happen. After debugging I found that sometimes index of dragged item is coming as undefined or e.item.data("uid") is coming as undefined. Please check into this.

 

Thanks,

Velu

 

Alexander Valchev
Telerik team
 answered on 06 Jun 2016
3 answers
460 views
I am confused why there is an AngularJS integration for Sortable Widget, when it doesn't support using ng-repeat.  In the demo here (http://demos.telerik.com/kendo-ui/sortable/index) - there is a hardcoded list of Li items that are being sorted.  However, no one using AngularJS is going to use a hard-coded list, they will use an ng-repeat from a data model.

The visual sort functionality of course works using an ng-repeat.  But once you move a list item, it does not update the data model source, rendering this widget pretty much useless for someone using Angular.  This widget needs a datasource integration.  

Please don't pretend to do these half-ass integrations any more.  They just waste people's time.

Do you have a solution to get it working with ng-repeat for me?  I would like to sort items, have my model updated with that new order, and then be able to use that new data model and send it back to the server, etc.

Thanks!
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
 answered on 25 May 2016
1 answer
91 views

Hi.

I'm making a "formula creator" in this demo: http://dojo.telerik.com/URuLO/3.

My problem is that I want to be able to sort the list view items too. The drag-drop works fine but it seems they conflict with Sortable in this case. So I can only drag list items to the end of the list and not re-arrange between them.

The question is: Can I use sortable in .k-listview in this case ?

Alexander Valchev
Telerik team
 answered on 02 May 2016
1 answer
139 views

 In the following example I want to sort the inner lists and not the other list. In my live example the lists are generated by the grouped list functionality, so I can't give each list an id and create a separate sortable object. How do I create a sortable set of inner lists using kendo native listview grouping? 

 

<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Unable to sort inner list in kendo nested list">
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.226/styles/kendo.common-material.min.css" />
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.226/styles/kendo.material.min.css" />
 
    <script src="//kendo.cdn.telerik.com/2016.1.226/js/jquery.min.js"></script>
    <script src="//kendo.cdn.telerik.com/2016.1.226/js/angular.min.js"></script>
    <script src="//kendo.cdn.telerik.com/2016.1.226/js/kendo.all.min.js"></script>
</head>
<body>
<div id="example" ng-app="KendoDemos">
    <div ng-controller="MyCtrl">
  <ul class="playlist" kendo-sortable k-placeholder="placeholder" k-hint="hint">
    <li>Happy
      <ul>
    <li>Papercut <span>3:04</span></li>
    <li>One Step Closer <span>2:35</span></li>
    <li>With You <span>3:23</span></li>
    <li>Points of Authority <span>3:20</span></li>
    <li>Crawling <span>3:29</span></li>
    </ul>
    </li>
    <li>Sad
   <ul>
      <li>Runaway <span>3:03</span></li>
    <li>By Myself <span>3:09</span></li>
    <li>In the End <span>3:36</span></li>
    <li>A Place for My Head <span>3:04</span></li>
    <li>Forgotten <span>3:14</span></li>
    <li>Cure for the Itch <span>2:37</span></li>
    <li>Pushing Me Away <span>3:11</span></li>
    </ul>
    </li>
  </ul>
</div>
<style>
    .playlist {
        margin: 30px auto;
        padding: 10px;
        width: 300px;
        background-color: #f3f5f7;
        border-radius: 4px;
        border: 1px solid rgba(0,0,0,.1);
    }
    .playlist li {
        list-style-type: none;
        position: relative;
        padding: 6px 8px;
        margin: 0;
        color: #666;
        font-size: 1.2em;
        cursor: move;
    }
    .playlist li:hover {
        background-color: #dceffd;
    }
    .playlist li span {
        position: absolute;
        right: 5px;
    }
    li.hint {
        display: block;
        padding: 10px;
        width: 200px;
        background-color: #52aef7;
        color: #fff;
    }
 
    li.hint:last-child {
        border-radius: 4px;
    }
 
    li.hint span {
        color: #fff;
    }
 
    li.placeholder {
        background-color: #dceffd;
        color: #52aef7;
        text-align: right;
    }
</style>
</div>
 
<script>
    angular.module("KendoDemos", [ "kendo.directives" ])
        .controller("MyCtrl", function($scope){
            $scope.placeholder = function(element) {
                return element.clone().addClass("placeholder").text("drop here");
            };
            $scope.hint = function(element) {
                return element.clone().addClass("hint");
            };
        })
</script>
 
 
</body>
</html>

In the following example I want to sort the inner lists and not the other list. In my live example the lists are generated by the grouped list functionality, so I can't give each list an id and create a separate sortable object. How do I create a sortable set of inner lists using kendo native listview grouping?

In the following example I want to sort the inner lists and not the other list. In my live example the lists are generated by the grouped list functionality, so I can't give each list an id and create a separate sortable object. How do I create a sortable set of inner lists using kendo native listview grouping?

In the following example I want to sort the inner lists and not the other list. In my live example the lists are generated by the grouped list functionality, so I can't give each list an id and create a separate sortable object. How do I create a sortable set of inner lists using kendo native listview grouping?

Alexander Popov
Telerik team
 answered on 06 Apr 2016
2 answers
38 views

Hi,

Over the last few days, I tried to build a demo using the kendo ui. I came across a few problems.

One of them is inability to change current column with mouse when, grid has editable.mode set to inline and sortable widget was added.

I have prepared simple demo http://dojo.telerik.com/EQIsA.

Is there any possibility to change column using mouse and sitll to have a sortable widged added? 

Best regards,

von
Top achievements
Rank 1
 answered on 24 Feb 2016
2 answers
34 views

I've dug all through the documentation, and I can find little allotment for iFrame support within the library. I also implemented a rough version, and found that upon entering the iFrame the mouse stopped responding. I tried some of the hidden iframe tricks I learned with other JS libraries, but nothing seemed to work.

Has anyone ever tried this before? Is it possible to make work?

We are on a trial version right now, this is a core requirement for us to switch over to this library though, so we're very interested in a straight answer on whether it's supported or not.

thanks!

Kevin
Top achievements
Rank 1
 answered on 27 Jan 2016
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?