Telerik Forums
Kendo UI for jQuery Forum
6 answers
2.0K+ views

I initially would have expected that the dataItems() method would have returned the items in the order that they appear in the list box.  However, the method does not.  Are there any plans to change this?  The best work around I can come up with is

var selectCols = $('#list`).data('kendoListBox');

selectCols.items().map(function(i, e) { return selectCols.dataSource.getByUid($(e).data('uid')); })

Is there a better, more durable approach that leverages public API's?

Thanks.

Alex Hajigeorgieva
Telerik team
 answered on 13 Mar 2019
1 answer
249 views

I have a Kendo listbox with a toolbar that allows sorting (up/down) and delete of a list item. When my listbox has enough items that extends it beyond the view of a mobile device, scrolling down causes the toolbar to scroll off screen. Because of this, if a user wants to move the bottom item of the listbox up, they have to scroll down, select the item, then scroll back up to access the toolbar actions, which makes for poor user experience. How can make the toolbar scroll along with list, or even just duplicate the toolbar at the bottom of the list?

 

 

Alex Hajigeorgieva
Telerik team
 answered on 13 Mar 2019
1 answer
191 views

I am using two listboxes, connected with each other, that allow drag and drop between the two. While using the reorder code found in another thread fixes the issue with reordering items within the same list, it doesn't address the issue when dragging and dropping an item from one listbox to the other. I understand that is because this isn't a "reorder" action, it is a "drop" action. I've tried many different angles, like using the "add" event, but there is no "offset" property in the (e) object.

How can I accomplish the same thing, that is, keep the dropped item in the order it is visually dropped?

Eyup
Telerik team
 answered on 13 Mar 2019
4 answers
484 views

Hello!

Would you please give me an idea where to start to solve the following problem:

I need two list boxes, lets' call them palette and list. 

I need to perform following actions via drag and drop:

1) COPY items from 'palette' to 'list' (e.g. item remains in 'palette' and appears in 'list'),

2) reorder items in 'list'

3) REMOVE items from 'list' (e.g 'item disappears at 'list' but does not appear at 'palette').

4) I do NOT need reordering in 'palette'. 

A practical example of such task would be... let say you have a restaurant menu and want to build an order dragging menu items into the order.

My guess was that it should be possible via analyzing the current drop target in drop or dragend events, but it seems like all I have there is the drag source and the items dragged.

The source code seems to try to determine the drop target via searching which of two listboxes (source or 'connected') the current placeholder belongs to, however I hesitate  to use this approach as placeholder information seems to be not a part of public API, so, I guess, there is no promise of backward compatibility in future.  

I also found an example you provided few years ago, where similar problem partially solved by simply adding the removed item back to palette, but this looks quite weird, I  would hesitate to use such visual behavior in a real project. 

So,  I would really appreciate a head up at an approach to be used, or to a good example on how this task is supposed to be solved in Kendo UI for JQuery architecture. 

Thank you very much for your time!

Tsvetomir
Telerik team
 answered on 19 Feb 2019
3 answers
844 views
I am using some code pulled from one of the Kendo examples for connecting two ListBoxes (populating the first with an AJAX call, and then letting the user transfer some of the items to the second listbox.

 

I currently have this set with an "EditorFor" approach.

Everything works fine, except that my Model never gets the selected users.

In the Model, that field is: 

IEnumerable<UserModel> SelectedEmployees

 

No matter what I've tried, the selected employees never get sent back to the Model with the other bits.

If I use jQuery to dump the dataitems to the Console, I can see what users have been selected.  They just don't go back to my model.

 

Is this possible?  Am I way out to lunch?  Or just missing something?

 

@using WMGPipeline.Models
@model IEnumerable<UserModel>
 
<div>
  <input type='text' id='searchBox' class='k-textbox' placeholder='Search By Name' />
  <br />
 
  @(Html.Kendo().ListBox()
        .Name("employees")
        .Toolbar(toolbar => {
          toolbar.Position(Kendo.Mvc.UI.Fluent.ListBoxToolbarPosition.Right);
          toolbar.Tools(tools => tools
            .TransferTo()
            .TransferFrom()
            .TransferAllTo()
            .TransferAllFrom()
            .Remove()
            );
        })
        .ConnectWith("SelectedEmployees")
        .DataTextField("LastFirst")
        .DataValueField("UserID")
        .DataSource(source => {
          source.Custom()
          .ServerFiltering(true)
          .Type("aspnetmvc-ajax")
          .Transport(transport => {
            transport.Read("getEmployees", "Pipeline");
          })
          .Schema(schema => {
            schema.Data("Data").Total("Total");
          });
        })
  )
  @(Html.Kendo().ListBox()
        .Name("SelectedEmployees")
        .DataTextField("LastFirst")
        .DataValueField("UserID")       
        .BindTo(Model)
        .Selectable(ListBoxSelectable.Multiple)
  )
/div>
Viktor Tachev
Telerik team
 answered on 09 Nov 2018
4 answers
637 views
Hi,

I'm using your Listbox widget and i'm facing this issue:

Everythime that i use it with data, all the options show up selected.

Ex:
<select...>
<option value="1" selected>Item 1</option>
<option value="2" selected>Item 2</option>
<option value="3" selected>Item 3</option>
...

Example here:
https://docs.telerik.com/kendo-ui/api/javascript/ui/listbox/methods/dataitem

When i manually select an option and send that information by POST, in 
the server side i cant know the option selected.

Is there any way to solve this problem?

Thank you
Georgi
Telerik team
 answered on 04 Oct 2018
5 answers
366 views

Hi,

I'm trying to add a group in my listbox.

But seems my code below is not working.

It only shows unidentified.

$("#optional").kendoListBox({
                    connectWith: "selected",
                    dataTextField: "Name",
                    dataValueField: "Name",
                    selectable: "multiple",
                    template: myTemplate,
                    groupable: true,
                    toolbar: {
                        tools: ["transferTo", "transferFrom", "transferAllTo", "transferAllFrom"]
                    },
                    dataSource: {
                        transport: {
                            read: {
                                url: "getmember" + id,
                                dataType: "json"
                            },
                            schema: {
                                model: {
                                    fields: {
                                         Name : { type: "string" },
                                        Id: { type: "string" },
                                        Location: { type: "string" }
                                    }
                                }
                            }
                        },
                        group: {
                            field: "Location"
                        }
                    },
                    columns: [
                        {
                            field: "Name",
                            title: "Name"
                        },
                        {
                            field: "Location",
                            title: "Location"
                        }
                    ]
                });
Alex Hajigeorgieva
Telerik team
 answered on 26 Sep 2018
3 answers
843 views

Is there a suggested way to filter the source listbox? I'm hoping to be able to type into a text box above the listbox and have the items in the listbox filter based on the value in the textbox.

I was looking into a basic angular filter, but am not sure of the best way to go about using it as it needs to be placed on the iterating element. 

 

Thanks!

Viktor Tachev
Telerik team
 answered on 25 Sep 2018
2 answers
418 views

Hello, 

I'm trying to get the dataTextField & dataValueField from double clicking on the ListBox. 

I feel like this should be easy but i cant find anything in the documentation or on google. 

 

So far i have this:

 

Preslav
Telerik team
 answered on 14 Aug 2018
4 answers
108 views

Hello,

I have written the code to transfer an element in the source listbox by double clicking on it as follows

function RegisterTransfer(ctrlId)
{
    var listBox = $("#" + ctrlId).data("kendoListBox");
    listBox.wrapper.find(".k-list").on("dblclick", ".k-item", function (e) {
        listBox._executeCommand("transferTo");
    });
}

this works fine.
But, I am unable to achieve the reverse scenario.

viz; I can't transfer an element in the destination listbox back to the source listbox by double clicking on it.
Any help would be appreciated!

Thanks, 
Niranjan

Niranjan
Top achievements
Rank 1
 answered on 09 Jan 2018
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?