I have a scheduler that is set to a month view and would like to implement the kendo-charts in each of the dates. Does anyone have any suggestions on how I should approach this or is this not possible? Any help would be appreciated.
Inside html:
<kendo-scheduler id="scheduler k-options="monthCtrl.scheduler"/>
Inside controller:
this.schedulerOptions = {
max: new Date(),
editable: false,
height: 1000,
views: [
"month"
],
};
How to set placeholder by template?
<
select
id
=
"a"
data-role
=
"multiselect"
data-placeholder
=
"template"
data-value-primitive
=
"true"
data-text-field
=
"name"
data-value-field
=
"id"
data-bind="value: valDoc
source: sourceDoc">
</
select
>
kendo.d.ts v2017.3.1026
should be
interface DataSourceSchemaModelFieldValidation {
required?: boolean | { message: string };
}
to support custom required message.
Hi,
I have set up a grid in our web application and have a problem related to the styles being applied to the pager buttons. The biggest problem I have is an issue with the first/previous and next/last buttons on the grid's pager being aligned strangely - We assume that this is related to a conflicting stylesheet or something, but for the life of me I can't find what it is.
There are some other problems too:
* The quick filter cell background's gradient seems to be off
* The filter dropdown button has its "funnel" icon aligned poorly.
Has anyone run into this issue before? If so, any tips?
Thanks.
How to change validationMessage of DropDown by css?
.k-dropdown-wrap .k-state-default{
validationMessage:"asdf";
validation-message: "cvhhh";
}
This css rule doesn't work!
When using multiple grids on the same page, the "de/select all" checkbox in the grid header will collide. Clicking the checkbox in the header of a second grid will (de)selected all the rows in the first grid instead of the second grid. Example, see: https://dojo.telerik.com/iYaZEG.
Hi I'm using the data annotation [Url] but kendo validator does not display the error and submit the form also the url is not valid.
what can I do?
here is my code:
this is my model:
public class NewProject
{
public int ID { get; set; }
[Required(ErrorMessage = "Please select a product")]
[Display(Name = "Product Name")]
public int? ProductID { get; set; }
[Display(Name = "Name")]
[Required(ErrorMessage = "Please enter name")]
public string Name { get; set; }
[Required(ErrorMessage = "Please select leader")]
[Display(Name = "Leader")]
public int? LeaderID { get; set; }
public string LeaderName { get; set; }
[Required(ErrorMessage = "Please select code reviewer")]
[Display(Name = "Code Reviewer")]
public int? CodeReviewerID { get; set; }
public string CodeReviewerName { get; set; }
public DateTime? ActualStartDate { get; set; }
public DateTime? ActualEndDate { get; set; }
[Required(ErrorMessage = "Please select a date")]
[DataType(DataType.Date)]
[UIHint("DatePickerEditor")]
[Display(Name = "Estimated Start Date")]
public DateTime? EstimatedStartDate { get; set; }
[Required(ErrorMessage = "Please select a date")]
[GreaterDate(EarlierDateField = "EstimatedStartDate", ErrorMessage = "End date should be after Start date")]
[DataType(DataType.Date)]
[UIHint("DatePickerEditor")]
[Display(Name = "Estimate End Date")]
public DateTime? EstimatedEndDate { get; set; }
[UIHint("PercentCompletedEditor")]
public int? PercentCompleted { get; set; }
[DataType(DataType.Url, ErrorMessage = "The Git url is not valid")]
[Url(ErrorMessage = "The Git url is not valid")]
[Display(Name = "Git Url")]
[Required(ErrorMessage = "Please enter an url")]
public string GitUrl { get; set; }
[Required(ErrorMessage = "Please enter comment")]
[Display(Name = "Comment")]
public string Comment { get; set; }
private List<ProjectManager> m_Managers;
public List<ProjectManager> Managers
{
get
{
if (m_Managers == null)
{
m_Managers = new List<ProjectManager>();
if (CodeReviewerID != null)
m_Managers.Add(new ProjectManager { ProjectID = ID, DeveloperID = (int) CodeReviewerID, RoleId = RoleEnum.CodeReviewer });
if (LeaderID != null)
m_Managers.Add(new ProjectManager { ProjectID = ID, DeveloperID = (int) LeaderID, RoleId = RoleEnum.Leader });
}
return m_Managers;
}
set
{
m_Managers = new List<ProjectManager>();
if (CodeReviewerID != null)
m_Managers.Add(new ProjectManager { ProjectID = ID, DeveloperID = (int) CodeReviewerID, RoleId = RoleEnum.CodeReviewer });
if (LeaderID != null)
m_Managers.Add(new ProjectManager { ProjectID = ID, DeveloperID = (int) LeaderID, RoleId = RoleEnum.Leader });
}
}
public List<Product> Products { get; set; }
public List<Developer> Developers { get; set; }
}
my view:
@using (Ajax.BeginForm("SaveNewProject", "Project", new AjaxOptions { OnSuccess = "onProjectSuccess" }, new { id = "projectForm" }))
{
<div class="form-horizontal" id="tempPage" style="margin-top:20px">
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.ProductID)
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-6 col-sm-6">
@Html.Kendo().TextBoxFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.CodeReviewerID, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-6 col-sm-6">
@(Html.Kendo().DropDownListFor(model => model.CodeReviewerID)
.Name("CodeReviewerID")
.HtmlAttributes(new { style = "width:220px;" })
.OptionLabel("Select Code Reviewer...")
.DataValueField("ID")
.DataTextField("Name")
.BindTo(Model.Developers))
@Html.ValidationMessageFor(model => model.CodeReviewerID, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.LeaderID, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-6 col-sm-6">
@(Html.Kendo().DropDownListFor(model => model.LeaderID)
.Name("LeaderID")
.HtmlAttributes(new { style = "width:220px;" })
.OptionLabel("Select Leader...")
.DataValueField("ID")
.DataTextField("Name")
.BindTo(Model.Developers))
@Html.ValidationMessageFor(model => model.LeaderID, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.EstimatedStartDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-6 col-sm-6">
@(Html.Kendo().DatePickerFor(model => model.EstimatedStartDate)
.Name("EstimatedStartDate")
.Format("MM/dd/yyyy")
.Value(DateTime.Now)
.Events(e => e.Change("startChangeEstimated").Open("startEstimatedOpen")))
@Html.ValidationMessageFor(model => model.EstimatedStartDate, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.EstimatedEndDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-6 col-sm-6">
@(Html.Kendo().DatePickerFor(model => model.EstimatedEndDate)
.Name("EstimatedEndDate")
.Format("MM/dd/yyyy")
.Value(DateTime.Now)
.Events(e => e.Change("endChangeEstimated").Open("endEstimatedOpen")))
@Html.ValidationMessageFor(model => model.EstimatedEndDate, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.GitUrl, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-6 col-sm-6">
@Html.Kendo().TextBoxFor(model => model.GitUrl)
@Html.ValidationMessageFor(model => model.GitUrl, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group" id="tempPage">
@Html.LabelFor(model => model.Comment, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-7 col-sm-7">
@Html.TextAreaFor(model => model.Comment, 11, 40, new { @class = "k-textbox" })
@Html.ValidationMessageFor(model => model.Comment, "", new { @class = "text-danger" })
</div>
</div>
<div class="container-fluid" style="padding-top:10px">
<hr id="newProjectHR" />
</div>
<div id="buttonPanel">
<input type="submit" value="save" class="k-button" id="btn_save_project" />
</div>
</div>
}
my kendo validator:
$(function () {
$("#projectForm").kendoValidator({
rules: {
greaterdate: function (input) {
if (input.is("[data-val-greaterdate]") && input.val() != "") {
var date = kendo.parseDate(input.val()),
earlierDate = kendo.parseDate($("[name='" + input.attr("data-val-greaterdate-earlierdate") + "']").val());
return !date || !earlierDate || earlierDate.getTime() < date.getTime()+1;
}
return true;
}
},
messages: {
greaterdate: function (input) {
return input.attr("data-val-greaterdate");
}
}
});
});
thank you!
Hi , i have only one editable column in my grid and i have included couple of validation on that column at model field level . which is working fine.
Now i am planning to include tab-out event so that on press of TAB and SHIFT+TAB focus will move to next/previous editable column ( in my case only one column is editable so it should go to next/previuos row same column). but TAB out event is called instantaneously so its creating some conflict with VALIDATION , so even if the validation fails focus is moving to next row which i dont want as it should TAB out only in case of validation is successful. i think its because TAB is called before the VALIDATION .
$("#tgrid_name .k-grid-content").on('keydown', function(e) { // TAB OUT LOGIC ON KEYDOWN EVENT
if (e.keyCode === kendo.keys.TAB && $($(e.target).closest('.k-edit-cell'))[0]) {
...
i need your suggestion on how to address this concern , i tried adding TAB out logic in closeCell instead in KEYDOWN event but there i am not able to capture the key value. could you please provide me any pointers to implement this .