Hello,
I have this Kendo DropDownTree control:
<kendo-dropdowntree name="ddtNamespaces" datavaluefield="Value" filter="FilterType.Contains" datatextfield="Text" style="width: 100%;"
check-all="true"
on-change="onNamespaceChange"
on-close="onNamespaceClose"
on->
<hierarchical-datasource>
<transport>
<read url="@Url.Action("GetNamespaceListFromATAsync", "AI")" />
</transport>
<schema type="json">
<hierarchical-model id="Id"></hierarchical-model>
</schema>
</hierarchical-datasource>
<checkboxes enabled="true" />
</kendo-dropdowntree>
I should send an ajax call after control change. When the user normally select a node it's working fine, but when the user clicks on 'All Items' node then the change event will be fired the combo-items-count times. So if I have 100 items in the combo, after click on 'All Items' the change event will be fired 100 times. This is not good for me, I would like send only one ajax call when 'All Items' item is selected.
I try a workaround to use the close event, and send the ajax call after closing the popup, but the close event is firing before all change event is finished so this not works.
Do you have any other idea to solve this? Thank you!
Is there anyway to use the DropDownTree without it having to make so many requests.
It looks like it is essentially building the tree one request at a time for each item inside it. This is ridiculously inefficient.
Why can't it be passed a single data structure in a request to build itself, after all a dropdownlist, combobox even a grid can be built with a single request for the IList<data> to databind.
There is little to no documentation on the DropDownTree control which is disappointing.
For a Data structure like this, it makes 6 request which makes no sense.
Could someone at telerik please provide an example of how to create such a data structure that can be passed to the DropDownTree in one request to allow it to render this. Currently this control is not very usable if it needs one request per item.
A treeview will load all it's data with a single request that returns an
var data = (IList<DataModels>)object .ToTreeDataSourceResult(request, e => e.ID, e => e.Parent_ID, e => e);
Does the DropDownTree not have something similar to a TreeDataSource? Why can't it use the same TreeDataSourceResult Object?
@model App.UI.Web.Models.SuitViewModel
@(Html.Kendo().DropDownTreeFor(x => x.subjectid) .Name("subjectsDDT") .HtmlAttributes(new { style = "width: 500px;" }) .DataSource(ds => ds.Read("ReadDropDownTreeSubjects", "BaseDirectory") ) .Placeholder("Select subject...") .Filter("contains") .DataTextField("name") .DataValueField("id") .ValuePrimitive(true) .ClearButton(false) .Events(ev => ev.Select("watch")) )
Hi,
I have one requirement need to implement dropdown tree in kendo ui grid using mvc
can any one provide sample code
thanks
I have a DropDownList and users are annoyed that whilst the data is loaded it says "No data found." when in fact, the data hasn't been loaded yet - I found this config item:
https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist/configuration/messages.nodata
How do I make one message appear whilst the data source is loading, and another message once the data has loaded (and in fact, there was no data found)
Hi,
I am trying to use the same Dropdownlist in a parent grid, and its hierarchal/child grid. This Dropdownlist was written in jQuery and is kept inside the Shared/EditorTemplates folder and works as expected for the parent grid. However, when I apply it to columns on the child grid, it does not appear. It ignores the template and prompts me for an input like usual for inline editing instead of displaying the dropdownlist options.
Is it possible to use the same EditorTemplate inside of a hierarchy grid?
While selecting an item from the dropdowntree control, items without children shows-up properly but those with child items don't have labels, including the child items. The <span class='k-in'> is empty, it is direct-child of <div class='k-bot'> which is under the <li role='treeitem'>.
I followed this example but omitted the second mapping because from the root parents to the children, they share the same structure. IEnumerable of my "TreeItem" class:
public class TreeItem<T>{
public T Item {get;set;}
public IEnumerable<TreeItem<T>> Children {get;set;}
public bool HasChildren {
get {
return this.Children != null && this.Children.Coun() > 0;
}
}
}
And here's how I configured the binding part:
@(Html.Kendo().DropDownTree()
.Name("Categories")
.BindTo(Model.CategoriesList, mapping => {
mapping.For<TreeItem<Category>>(binding => binding
.Children(c => c.Children)
.ItemDataBound((item, categ) => {
item.Expanded = true;
item.HasChildren = categ.HasChildren;
item.Id = categ.Item.Id;
item.Text = categ.Item.Name;
item.Value = categ.Item.Id.ToString();
})
)
})
.LoadOnDemand(false)
)
the Model.CategoriesList is IEnumerable<TreeItem<Category>> which makes it the same structure as the Children of the TreeItem<Category> in here, if it matters.
Hey,
So i have a very simple form 2 controls on it,
1 DropdownList
1 DropDownTree
<
div
class
=
"col-lg-12 col-md-12 col-sm-12 col-xs-12"
>
@Html.Kendo().DropDownListFor(a => a.BranchId).OptionLabel("Select Branch").DataTextField("Text").DataValueField("Value").BindTo(Model.BranchList).HtmlAttributes(new { @class = "ff_required ff_control", @required = "required" })
</
div
>
<
div
class
=
"col-lg-12 col-md-12 col-sm-12 col-xs-12"
>
<
label
class
=
"ff_label"
>Select a parent category (optional) <
span
class
=
"ParentCategoryTip"
><
img
src
=
"~/Images/icons/help.png"
/></
span
></
label
>
</
div
>
<
div
class
=
"col-lg-12 col-md-12 col-sm-12 col-xs-12"
>
@(Html.Kendo().DropDownTreeFor(a => a.ParentCategoryId)
.DataTextField("Name")
.DataValueField("id")
.Placeholder("Select Category")
.HtmlAttributes(new { style = "width: 100%" })
.Events(events => events
.Change("DropdownTreeChange"))
)
By default when the page loads i do not want to DropdownTree to bind to anything, it must be blank. Only once a selection is made from the BranchId DropDownList then i want the DropDownTree to be populated by passing the BranchId to the action method.
Here is what i have so far
$(
"#BranchId"
).on(
"change"
,
function
() {
var
tree = $(
"#ParentCategoryId"
).data(
"kendoDropDownTree"
);
var
val = tree.value();
tree.refresh({
url:
"/Setting/GetCategorylist"
,
data: {
Id: val,
BranchId: $(
"#BranchId"
).val()
}
});
});
[HttpGet]
//public async Task<ActionResult> GetCategorylist([DataSourceRequest] DataSourceRequest request, int BranchId)
public
async Task<ActionResult> GetCategorylist(
int
? Id,
int
BranchId)
{
var Result = await
new
_GetCategoryTreeList(
new
FF_ErrorLogger()).GetIdAsync(
null
,BranchId);
return
Json(Result, JsonRequestBehavior.AllowGet);
}
i cannot get the DropDownTree to rebind its data.
I don't see where Client Filtering must have LoadOnDemand set to false, but I am guessing it would, correct?
Or does it simply filter on what has been sent down to the client?
I mean how could you search on something not yet loaded?
I have managed to get the searching to work with our existing systems however i have noticed that if items with the same "Value" are returned at different levels. For example, if i am looking for people by their username/name so if i have a person named "sysadmin" who is also part of a group called "Administrators" they are returned at two different levels within the tree and selecting both of them results in the selection appearing multiple times within the textbox. Is there some way that i can link these two (or more) items?
The other problem i am having is that when data is fetched from the server, we also provide an indicator that there are more matched results that are not returned in the search (because we are only displaying the first 20). The total number of matched results is returned as part of the response.
e.g.
{
"Data"
: [
/* 20 items */
],
"Total"
: 223
}
In our other dropdownlist selectors we use virtual scrolling to continuously fetch more results and in our grid and list view pages we use paging.
Is there some way that i can indicate to a user that there are more items that could have been returned but weren't? Either by including some sort of paging functionality or appending an indicator of some kind to the item list.