Hello
I have a multiselect widget working in AutoBind mode. To speed up display, as long as the field is not changed, I would like to load the selected values using Autobind(false) and load the selected Items in .Value() as per the docs.
I have verified that Model.SelectedOwners contains the DataValues and Model.SelectedOwnersPreload contains a List of Items with Name / Id with the same DataValues.
If I set Autobind(true), the widget works as expected but is slow to read the full list of available items from the datasource.
If I set Autobind(false) the widget works correctly on first load of the page. However, when the Form posts back and is rendered again, the selected Values are no longer shown, even though I render the page through the same code as on initial load and in the View, both the Value List (Model.SelectedOwners) and the Item List (Model.SelectedOwnersPreload) provide the expected Values.
What am I missing?
Currently the Code is:
@(Html.Kendo().MultiSelectFor(m => m.SelectedOwners) .DataTextField("Name") .DataValueField("Id") .Placeholder(StringResource.SoftwareItemOwnersPlaceholder) .AutoBind(true) .DataSource(source => { source.Read(read => { read.Action("GetAvailableOwners", "SoftwareItem"); }); }).Value( Model.SelectedOwnersPreload) )
Regards,
Erwin
In Day View only the "Title" field is visible. Without creating a custom view, is it possible to also make the "Description" field visible in Day View?
Thanks

Hi
I have got an issue where there is a 35px wide gap at the left hand side of all my line graphs.
Please see here for a demo
http://vsdash-test.azurewebsites.net/
I would like the line graph to display the full width of the blue area, and remove the blank space to the left.
When i expect the code, I am inside the markup used to create the SVG file.
Is there anyway I can remove this space at the left side?
Thank you for your time.

I added a resource using the following code:
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.resources[0].dataSource.add({
Text: "aaaaaBBBBBB",
Value: 23,
Color: "#FFFFFF"
});
scheduler.view(scheduler.view().name);
How can I get the resources to sort by Text so that it shows up in order and not at the end?

I am using a Kendo MVC Scheduler control with a TimeLine view and I am adding new events via an ajax call to my server to add to a table that holds scheduler events. I need a way to refresh the scheduler or to add an event manually just so it will show up until the next refresh. Is there an easy way to do that?
I tried the following but it doesn't call my read method:
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.resources[0].dataSource.read().then(
function () {
scheduler.view(scheduler.view().name);
});
This is my client side code:
<% Html.Kendo().Scheduler<WheresMyTool.Models.MeetingViewModel>()
.Name("scheduler")
.Date(new DateTime(2016, 12, 16))
.StartTime(new DateTime(2016, 12, 16, 7, 00, 00))
.MajorTick(60)
.EventTemplate(
"<div class='#= eventStyle #' title='#= description #'>" +
"#= title #" +
"</div>")
.Views(views =>
{
views.TimelineWeekView(timeline =>
{
timeline.EventHeight(25);
timeline.ColumnWidth(1);
});
views.TimelineView(timeline =>
{
timeline.EventHeight(25);
timeline.ColumnWidth(10);
});
views.TimelineMonthView(timeline =>
{
timeline.StartTime(new DateTime(2016, 12, 16, 00, 00, 00));
timeline.EndTime(new DateTime(2016, 12, 16, 00, 00, 00));
timeline.MajorTick(1440);
timeline.MinorTickCount(1);
timeline.EventHeight(25);
timeline.ColumnWidth(10);
});
})
.Editable(a => a.Confirmation(false))
.Timezone("Etc/UTC")
.Group(group => group.Resources("Attendees").Orientation(SchedulerGroupOrientation.Vertical))
.Events(e =>
{
e.DataBound("schedulerDataBound");
e.Edit("scheduler_edit");
e.Add("scheduler_add");
})
.Resources(resource =>
{
resource.Add(m => m.Attendees)
.Title("Attendees")
.Name("Attendees")
.Multiple(true)
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(Model.resourceList);
})
.DataSource(d => d
.AutoSync(true)
.Read("SchedulerRead", "Scheduler")
.Create("SchedulerCreate", "Scheduler")
).Render();
%>
Hi,
I was hoping someone could help me with the issue I have in storing the order of sortable panels within the local storage.
Here is some example code I am using:
-----------------------------------------------------------------------------------------
.........
string name = string.Format("main-content{0}", colCounter);
<div id = "@name" >
@{
foreach (var colItem in cols)
{
@renderTiles(colItem);
}
}
</div>
..................
@(Html.Kendo().Sortable()
.For("#main-content1")
.ConnectWith("#main-content2,#main-content3")
.Cursor("move")
.PlaceholderHandler("placeholder")
.HintHandler("hint")
)
@(Html.Kendo().Sortable()
.For("#main-content2")
.ConnectWith("#main-content1,#main-content3")
.Cursor("move")
.PlaceholderHandler("placeholder")
.HintHandler("hint")
)
@(Html.Kendo().Sortable()
.For("#main-content3")
.ConnectWith("#main-content1, #main-content2")
.Cursor("move")
.PlaceholderHandler("placeholder")
.HintHandler("hint")
)
.............
<script>
var localStorageSupport = (('localStorage' in window && window['localStorage'] !== null)),
data,
html;
if (localStorageSupport) {
data = JSON.parse(localStorage.getItem("sortableData"));
} else {
alert("your browser does not support local storage");
}
$(document).ready(function ()
{
$('.widget').click(function (e) {
window.location.href = $(e.target).attr('href');
})
$('.widget').change(function (e) {
var item = data.splice(e.oldIndex, 1)[0];
data.splice(e.newIndex, 0, item);
localStorage.setItem("sortableData", kendo.stringify(data))
})
})
</script>
@helper renderTiles(IPublishedContent Section)
{
var title = Section.GetPropertyValue<string>("tiitle", String.Empty);
var icon = Section.GetPropertyValue<string>("icon", String.Empty);
int intLink = Section.GetPropertyValue<int>("intLink", 0);
var extLink = Section.GetPropertyValue<string>("extLink", String.Empty);
var imgId = Section.GetPropertyValue("icon", -1);
var Url = string.Empty;
if (@intLink == 0 && @extLink.Length > 0)
{
Url = @extLink;
}
else if (@intLink != 0 && @extLink.Length == 0)
{
Url = Umbraco.NiceUrl(@intLink);
}
<div id="panes" class="widget" header="@title" href="@Url">
<div header="@title" href="@Url">
@title
<div class="widget-image" header="@title" href="@Url">
@if (imgId != -1)
{
<img src="@Umbraco.TypedMedia(imgId).Url" alt="=@Umbraco.TypedMedia(imgId).Name" title="@title" header="@title" href="@Url" />
}
</div>
</div>
</div>
}
I have looked at the following:
http://docs.telerik.com/kendo-ui/controls/interactivity/sortable/overview
http://docs.telerik.com/kendo-ui/controls/interactivity/sortable/how-to/persist-order-in-localstorage
http://www.telerik.com/forums/saving-sortable-state
These do make sense but I am having a bit of a senior moment with what I am trying to do.
Many thanks.
J
@model IEnumerable<HCS.Model.FinancialInstitution>@(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(p => p.MainRT).Groupable(false); columns.Bound(p => p.LegalName); }) .Pageable() .Sortable() .Scrollable() .Filterable() .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false)))@model IEnumerable<HCS.Model.FinancialInstitution>@(Html.Kendo().Window() .Name("window") .Title("Choose a Financial Institution (FI)") .Content(() => { @Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(p => p.MainRT).Groupable(false); columns.Bound(p => p.LegalName); }) .Pageable() .Sortable() .Scrollable() .Filterable() .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false)); }) .Draggable() .Resizable() .Events(ev => ev.Close("onClose")) .Width(400) )
I am unable to figure out why the HttpPostedFileBase is always null in my upload widget. Sample Project showing the issue.
View
@using (Html.BeginForm()){ @Html.AntiForgeryToken() <div class="row row-spacing-bottom"> <div class="col-md-12"> @(Html.Kendo().Upload() .Name(Html.IdFor(model => model.HttpPostedFileBase).ToString()) .Multiple(false) .Messages(m => m.Select("Select a File")) .Events(e => e.Select("uploadHelper.checkFileSize")) .Deferred()) </div> </div> <div class="row"> <div class="col-md-12"> @(Html.Kendo().Button() .Name("Submit") .Content("Upload File") .HtmlAttributes(new {type = "submit"}) .Deferred()) </div> </div>}
Controller:
public class FileUploadController : Controller { public ActionResult FileUpload() { return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult FileUpload(Models.FileUpload fileUpload) { var result = fileUpload.HttpPostedFileBase != null; return Json(new {success = result}); } }
Submit function:
$('form').submit(function () { layout.showLoadingScreen(true); $.ajax({ url: this.action, type: this.method, data: $(this).serialize(), success: function (result) { if (result.success) { layout.showNotification("Save Successful", "success"); layout.showLoadingScreen(false); } else { layout.showNotification("Error Saving Record", "error"); layout.showLoadingScreen(false); } } }); return false; });
Hello guys.
Unfortunately, I've found an error in Kendo (there is no such error in 2015.3.930.545 (just for information))
Check the example project.
https://www.dropbox.com/s/7h8gm1ekyui56qq/KendoUI.rar?dl=0
Description:
- I have two grids.
- They both have a field "Volume" and calculate the sum of this field.
- They don't have any other aggregates for other fields. (it's important)
What I have:
1) Static class "ClassFactory" ("~/Infrastructure/Implementation/ClassFactory.cs") which has a variable Dictionary<Signature, Type> classes.
2) Class "Signature" ("~/Infrastructure/Implementation/Signature.cs") that has a method "Equals"
3) ArgumentException
Description:
When one of grid sends a request to controller, some manipulations are performed and we find ourselves in "ClassFactory" in a method "GetDynamicClass". Here a variable (name - signature) of type "Signature" is added to the variable "classes" of type "Dictionary<Signature, Type>". No problems, everything is fine. Then another grid does the same steps. But now, when the variable "signature" is being added to the variable "classes", I get exception "ArgumentException". Why? Look at the code of the method "Equals" of the class 'Signature':
if (poperties.Length != other.properties.Length) return false;
for (int i = 0; i < properties.Length; i++)
{
if (properties[i].Name != other.properties[i].Name || properties[i].Type != other.properties[i].Type)
return false;
}
return true;
Aggregates for the first grid: Sum_Volume for the field "Volume"
Aggregates for the second grid: Sum_Volume for the field "Volume"
Conclusion:
Aggregates are the same, so the method "Equals" returns true
And that's why I get "ArgumentException" (An item with the same key has already been added)
Solution:
People who have the same error:
You can:
1) Add the hidden field to the grid (to the model) and aggregate sth (for ex: sum) for this field. (if you have more than 2 grids with such problem, don't forget that these hidden fields must have different names, otherwise it won't help)
2) You can rename a field in one of the grids
3) Wait until Kendo fixes it :)
4) Maybe someone has another idea?!
