I am using a DatePicker in a Modal to change the dates of various records without reloading the whole page. The Modal is loaded via an Ajax call. The modal contains a form and a single field similar to:
@(Html.Kendo().DatePickerFor(x => x.ScheduledDate)
.Start(CalendarView.Year)
.Depth(CalendarView.Month))
)
This works fine the first time the modal loads but on subsequent calls, the date picker is not rendered and an unstyled textbox is shown instead.
I am guessing that this has something to do with the fact that the page has already handled a control with the same id but because the modal has been replaced with new html, there are no duplicate ids on the page and I want to force kendo to render the picker again on the new control.
How do I do this?
I've got a Kendo editor with custom CSS styles that I'm importing via a custom style sheet. Is there a way to apply the classes to the p element instead of wrapping the text with a span element. I'm trying to control how the user formats the text to just the classes in my style sheet.
Thanks.
@(Html.Kendo().EditorFor(model => model.HtmlContent)
.HtmlAttributes(new { style = "width: 85%;height:600px;" })
.Encode(false)
.Tools(tools => tools
.Clear()
.Bold().Italic().Underline().Strikethrough()
.JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
.InsertUnorderedList().InsertOrderedList()
.Outdent().Indent()
.CreateLink().Unlink()
.InsertImage()
.InsertFile()
//.SubScript()
//.SuperScript()
.TableEditing()
.ViewHtml()
.CleanFormatting()
//.FontName()
//.FontSize()
//.FontColor().BackColor()
.Formatting(formatting => formatting
.Add("Intro Paragraph", ".doc-intro-paragraph")
.Add("FAQ Question", ".doc-question")
.Add("FAQ Answer", ".doc-answer")
.Add("Section Title", ".doc-section-title")
)
)
.PasteCleanup(p => p
.All(false)
.Css(true)
.KeepNewLines(false)
.MsAllFormatting(true)
.MsConvertLists(true)
.MsTags(true)
.None(false)
.Span(true)
)
.StyleSheets(css => css.Add(Url.Content("~/Content/TextEditor.css")))
.ImageBrowser(imageBrowser => imageBrowser
.Image("~/Content/Images/{0}")
.Read("Read", "ImageBrowser")
.Create("Create", "ImageBrowser")
.Destroy("Destroy", "ImageBrowser")
.Upload("Upload", "ImageBrowser")
.Thumbnail("Thumbnail", "ImageBrowser")
)
.FileBrowser(fileBrowser => fileBrowser
.File("~/Content/Documents/{0}")
.Read("Read", "FileBrowser")
.Create("Create", "FileBrowser")
.Destroy("Destroy", "FileBrowser")
.Upload("Upload", "FileBrowser")
)
)
Hello,
In our MVC project we used two kendo dropdownlist widgets. Since data may become huge we implemented virtual.valueMapper() to get job done. Both dropdownlist worked as expected but when I debug code and found one of valueMapper() never be called. Those two dropdownlist had exactly same setting. Why they are function differently? I am so curious the reason. Could someone explain this? Below are the code. Thanks in advance.
<div class="col-lg-3 col-md-3 col-sm-3">
@(Html.Kendo().DropDownListFor(model => model.FIELD1)
.DataTextField("Display")
.DataValueField("Value")
.Filter("contains")
.DataSource(source =>
{
source.Custom()
.ServerFiltering(true)
.ServerPaging(true)
.PageSize(80)
.Type("aspnetmvc-ajax")
.Transport(transport =>
{
transport.Read("GetField1Data", "Editor");
})
.Schema(schema => schema.Data("Data").Total("Total"))
;
})
.Virtual(v => v.ItemHeight(26).ValueMapper("valueMapperField1"))//<- never be called
)
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
@(Html.Kendo().DropDownListFor(model => model.FIELD2)
.DataTextField("Display")
.DataValueField("Value")
.Filter("contains")
.DataSource(source =>
{
source.Custom()
.ServerFiltering(true)
.ServerPaging(true)
.PageSize(80)
.Type("aspnetmvc-ajax")
.Transport(transport =>
{
transport.Read("GetField2Data", "Editor");
})
.Schema(schema => schema.Data("Data").Total("Total"))
;
})
.Virtual(v => v.ItemHeight(26).ValueMapper("valueMapperField2")) //<- call valueMapperField2 function correctly.
)
</div>
I'm having an issue that I need help with.
First, I'll explain what I need to do. I need to set three properties on a Grid
1.- The "pageSizes" (the options on the "items per page" dropdown).
2. The "pageSize" (default page size for the grid).
3.- The "height".
I'm doing this using the "setOptions" method, like this:
grid.autoBind = false;
grid.setOptions({
groupable: true
, pageable: {
pageSizes: selPageSizes,
pageSize: selDefaultPageSize
}
, dataSource: { pageSize: selDefaultPageSize }
, height: selGridHeight
});
This is working fine, but I'm getting an error. The grid is refreshed after calling the .setOptions method (I understand that it is the expected behavior) and I get the "Cannot read property 'removeClass' of null" (screenshot attached, along with the screenshot of the code that is triggering this error).
I tried setting the "autoBind" property to "false" before calling the .setOptions method, but I'm still getting the error.
I've checked on the forum, and I found the following post:
https://www.telerik.com/forums/i-m-sometimes-getting-this-error-ucaught-typeerror-cannot-read-property-%27removeclass%27-of-undefined
I tried what was suggested there, but some things won't apply, and the others won't work (BTW, the first link is broken, which was the most promising one).
So, is there a way that I can prevent the grid to refresh after calling .setOptions? Or there's something that I can do to avoid the error, if the grid is refreshed?
Or is there any other way to set the three properties that I mentioned at the beginning of the post?
I have a requirement that on a page that already contains a number of widgets to display a window that contains the same widgets.
The problem is that the page and the partial view loaded in the window are created using
@Html.Kendo().XXXFor(m => m.Property)....
and have discovered that when I load the window the widget on the page disappear and the widget on the window is not created. Also there are a lot of errors in the kendo code.
Is there a way to change the name that is required by the telerik but to leave the input names as they are?
Hi everyone,
I have created a view page that displays four charts, now I want to PDF each of these charts on one page so four pages total.
So far I can export all four charts on a single page.
is there any way to achieve this, is it possible.
thanks
Ray
Hi All,
Just wondering where to find sample to invoke item command for checked item on my kendo grid using my custom button?
Also how to show that row is selected when I check the checkbox?
Lastly how to unchecked my header template checkbox when I change page?
columns.Bound(column => column.ProfileID)
.ClientTemplate("<
input
class
=
'box'
type
=
'checkbox'
value
=
'#=ProfileID#'
/>")
.ClientHeaderTemplate("<
input
type
=
'checkbox'
id
=
'selectAll'
onclick
=
'toggleSelection()'
/>")
.Width(40)
.Sortable(false)
.Filterable(false);
Thanks in Advance
Ryan