kendoDraggable filter syntax

5 posts, 0 answers
  1. Ozzy
    Ozzy avatar
    6 posts
    Member since:
    Dec 2011

    Posted 08 Nov 2013 Link to this post

    Hi,

    I would like to know if there is any documentation on the filter parameter for the kendoDraggable function.  I have searched a lot and not found anything.

    My current situation is that I have drag and drop working between 2 kendo ui grids and all is great.  However, the draggable filter is currently:
    filter: "tbody > tr"
    This causes the whole line to then display in the drag.  I would like to find a way to specify the first column in that row and not the whole row.

    Any input would be greatly appreciated.

  2. Ozzy
    Ozzy avatar
    6 posts
    Member since:
    Dec 2011

    Posted 08 Nov 2013 Link to this post

    I just found a way to accomplish what I want for now, although I would still like to know how the syntax works for the future.

    My current solution was to change my original hint:
    hint: function (e) {
        return $('<div class="k-grid k-widget drag" style="width: 300px"><table><tbody><tr>' + e.html() + '</tr></tbody></table></div>');
    }
    to use a javascript substr to show only the first cell as follows:
    hint: function (e) {
        return $('<div class="k-grid k-widget drag" style="width: 300px"><table><tbody><tr>' + e.html().substr(0, e.html().indexOf('</td>')) + '</tr></tbody></table></div>');
    }
    This resolves my current issue, but my original question still stands. 
  3. Kendo UI is VS 2017 Ready
  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 11 Nov 2013 Link to this post

    Hello Ozzy,

    In the filter and hint configuration options you pass a valid jQuery selector that will be used to select the elements that you want to operate with. You can check the following article if you want to familiarize yourself with the jQuery selectors:

    http://api.jquery.com/category/selectors/
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Ozzy
    Ozzy avatar
    6 posts
    Member since:
    Dec 2011

    Posted 12 Nov 2013 Link to this post

    Hi Kiril,

    I had assumed that the filter functions using the normal jQuery selectors, however, in trying a selector as follows, it does not work:
    filter: "tbody > tr > td:eq(1)"
    Can you confirm whether a filter like this will actually work?  Is it possibly a bug?
  6. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 12 Nov 2013 Link to this post

    Hello Ozzy,

    As this is a valid jQuery selector, it should be working as expected. Could you please extract a runnable sample, that is showing the incorrect behavior, so we can take a look?
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready