Telerik Forums
Kendo UI for jQuery Forum
1 answer
276 views

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>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ivan Danchev
Telerik team
 answered on 19 Jan 2018
3 answers
206 views

kendo.d.ts v2017.3.1026

should be 

 interface DataSourceSchemaModelFieldValidation {
   required?: boolean | { message: string };

}

 

to support custom required message.

Viktor Tachev
Telerik team
 answered on 19 Jan 2018
3 answers
310 views

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.

EBMS Stuart
Top achievements
Rank 1
 answered on 18 Jan 2018
1 answer
204 views

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!

 

Magdalena
Telerik team
 answered on 18 Jan 2018
2 answers
192 views

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. 

Preslav
Telerik team
 answered on 18 Jan 2018
1 answer
688 views

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!

Stefan
Telerik team
 answered on 18 Jan 2018
14 answers
477 views
Hello,

How to handle a master - detail situation with datasources?
Of course I can use two separate datasource to read the data from the server.
But how to update the data to the server in one transaction?
In that case you would want to have one POST request to the server per master record including it's details.
But I am not aware of the ability to setup such relation between datasources.
Ideally you want to have such JSON object:
{ Field1: xxx, Field2: yyy, Details: [{ DetField1: aa, DetField2: bb }, { DetField1: cc, DetField2: dd }] }

Any ideas?

Regards, Jaap
Viktor Tachev
Telerik team
 answered on 18 Jan 2018
1 answer
466 views

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 . 

 

Stefan
Telerik team
 answered on 18 Jan 2018
4 answers
377 views
In my kendo chart ( http://jsbin.com/eWIniqi/1/edit ) it renders properly with correct grouping etc. unless the data is missing a Code: "No" for a month.

If you remove one of the Code: "No" for a month, the categoryAxis label disappears ( http://jsbin.com/aQaXorE/2/edit ).  I can remove a yes or not specified, and the categoryField shows up fine ( http://jsbin.com/aQaXorE/3/edit ).

My data is being pulled from some evaluations that are done and may not have all three fields represented (Ideally we would only have Code: "yes" responses).
Is there some way to make sure the categoryAxis field label is shown, or perhaps there is a better way to build this chart ?

Thanks

Robin
Stefan
Telerik team
 answered on 18 Jan 2018
3 answers
353 views

Hi All , i am aware that KendoGrid provides columns aggregates in the footer template , my requirement is to populate a editable column aggregate/sum into a separate div element present in form . currently i am looping through all the records in the grid where dirty-lag= true and editable column val >0 . Is there is any other way to address this more efficiently like how JQGrid provides .

 

Example of JqGrid - i can get the sum of a column without looping through all the records .

var sum = $(<GRID_NAME>).jqGrid('getCol','<COLUMN_NAME>',false,'sum');

 

 

Stefan
Telerik team
 answered on 18 Jan 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
ContextMenu
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?