$(document).ready(function () { $("#_UploadedFiles").closest(".k-upload-button").find("span").text("bla bla");});Hello,
we are changing our application from Telerik Controls to Kendo UI. But changing the TreeView is a little bit difficult. I hope you can help me:
With Telerik we used the OnDataBinding- Event, called a controller-class and bound a json-result to our tree: tree.bindTo(jsonObject)
Well this isn't possible with KendoUI.
So I tried the DataSource-thing on our tree:
@(Html.Kendo().TreeView().Name("TreeView").DataTextField("Text").DataImageUrlField("ImageUrl").DataUrlField("Url").DataSource(dataSource => dataSource.Read(read => read.Action("GetTreeData", "Home"))).ExpandAll(true)Without all these DataTextField, DataImage.. stuff nothing worked so after hours I found out that I need them (there has to be a better documentation... please). But: How can I add ChildElements? With hasChildren (as a Property on the Json-Object) Ithe TreeView knows that there are children but I also wanna show them after binding (.ExpandAll(true).... <-- wanna use it!)
I really hope you can help me. I want to bind the complete tree-structure at once. No Load on demand. Is there any solution for doing that?
And if I have my complete tree... how am I able to rebind it? We need to refresh the tree very often, so I hope you can show me a possibility to do that.
Thank you very much!
Mathias
columns.Bound(p => p.SaleDate).Format("{0:yyyy-MM-dd}").EditorTemplateName("saleDatePicker");then I also have
<script type="text/x-kendo-template" id="saleDatePicker" > @(Html.Kendo().DatePicker().Name("SaleDatePicker")) </script>For a datepicker, should I even be doing anything or should it be automatic?
columns.Bound(e => e.WeekStart).Format("{0:yyyy-MM-dd}");columns.Bound(e => e.WeekStart.Date).Format("{0:yyyy-MM-dd}");columns.Template(@<text></text>) .Width(50) .ClientTemplate("#= getDeleteHTML(Id, DisplayLocation) #");function getDeleteHTML(itemId, itemName) { var deleteHtml = "<form action='"+ '@Url.Action("Delete", "ManageLocations")'+"/" + itemId +"' method='post'>" + "<input type='image' onclick='return confirm(\"Are you sure you wish to delete: \r\n " + itemName + "?\");' value='Delete' class='delete' src='../Images/transparent.gif'>" + "</form>"; return deleteHtml; }I want to break the confirmation message into 2 lines. I've tried \r\n and @Environment.NewLine + itemName as I'm not sure which parser is being used (client or server) in this case.
How can I achieve this? Sorry, I am fairly new to client side scripting so I'm sure this is easy, but supposedly just \r\n should work, but it doesn't...here is what is rendered in the browser:
<form action="/CompanyMgmt/ManageLocations/Delete/1003" method="post"><input type="image" onclick="return confirm("Are you sure you wish to delete:RECV-A-01-1-1-1?");" value="Delete" class="delete" src="../Images/transparent.gif"></form>