I have multiple text boxes where users can enter search parameters to query an Oracle database to return data to a grid. I ham having a hard time validating these text boxes as a group. By group I mean that I want to make sure that at least 1 text box has data in it. If I dont, the user could potentially bring back 16 million records. This obviously will take a while and I cant have that. I have tried about 5 different ways to do this. I can validate each field but i cant move on because each field is requiring something. Again, I want to check and make sure that at least one of the 9 text boxes has something in it. I apologize the mess of the validation code. has mixes of a few different ways I was trying.
The attached photo shows that my current way of thinking is wrong. Since there is a value in one text box, the rest of the validations should technically be true and it should move on to the next step - populating a data grid.
code body:
<div class="col-lg-12 col-md-12">
<div class="panel panel-primary" style="margin-top:5px;" id="CustHistSearchPanel">
<div class="panel-heading">
<h3 class="panel-title" id="collapseAll" data-toggle="collapse" data-target="#collapsePanelCustHist" href="#collapsePanelCustHist">
Customer History
</h3>
</div>
<div id="collapsePanelCustHist" class="panel-collapse collapse in">
<div class="panel-body" id="CustHistSearchPanelBody">
<form id="CustHistForm" data-role="validator" novalidate="novalidate">
<div class="col-lg-12 col-md-12">
<div class="col-lg-3 col-md-3">
<div class="form-group">
<label for="acctNum">Account Number</label>
@Html.TextBox("acctnum", "",
new
{
@class = "form-control formElements",
@id = "acctNum"
})
<label for="premiseNum">Premise Number</label>
@Html.TextBox("premisenumber", "",
new
{
@class = "form-control formElements",
@id = "premiseNum"
})
<label for="timeFrame" class="control-label">Timeframe</label><br />
@Html.RadioButton("timeframe", "1", new { @type = "radio", @class = "formElements", @id = "ALL" }) All
@Html.RadioButton("timeframe", "2", new { @type = "radio", @class = "formElements", @id = "LAST5" }) Last 5 Years
@Html.RadioButton("timeframe", "3", new { @type = "radio", @class = "formElements", @id = "YTD" }) YTD
@Html.RadioButton("timeframe", "4", new { @type = "radio", @class = "formElements", @id = "MTD", @checked = "checked" }) MTD
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="form-group">
<label for="busLastName">Bus/Last Name</label>
@Html.TextBox("buslastname", "",
new
{
@class = "form-control formElements",
@id = "busLastName"
})
<label for="firstName">First Name</label>
@Html.TextBox("firstname", "",
new
{
@class = "form-control formElements",
@id = "firstName"
})
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="form-group">
<label for="houseNum">House Num</label>
@Html.TextBox("housenum", "",
new
{
@class = "form-control formElements",
@id = "houseNum"
})
<label for="street">Street</label>
@Html.TextBox("street", "",
new
{
@class = "form-control formElements",
@id = "street"
})
<label for="cityState">City, State</label>
@Html.TextBox("citystate", "",
new
{
@class = "form-control formElements",
@id = "cityState"
})
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="form-group">
<label for="homePhone1">Home Phone</label>
@Html.TextBox("homephone", "",
new
{
@class = "form-control formElements",
@id = "homePhone",
@type = "text"
})
<label for="contactPhone">Contact Phone</label>
@Html.TextBox("contactphone", "",
new
{
@class = "form-control formElements",
@id = "contactPhone"
})
</div>
</div>
</div>
</form>
Validation code:
$(function () {
var formContainer = $("#CustHistForm");
kendo.init(formContainer);
formContainer.kendoValidator(
{
rules:
{
customRule: function (input)
{
var isValid = true;
var count = 0;
$('input[type="text"]').each(function ()
{
if ($.trim($(this).val()) == '')
{
isValid = false;
$(this).css(
{
"border": "1px solid red",
"background": "#FFCECE"
});
count = count + 0;
}
else
{
count = count + 1
isValid = false;
$(this).css(
{
"border": "",
"background": ""
});
}
})
{
if (count > 0) {
isValid = true;
}
isValid = input.val().match(/^\S+$/) != null;
console.log("[name2=" + input.attr("name") + '] ' + isValid + ' ' + count);
}
return isValid;
console.log(isValid);
}
},
messages:
{
customRule: "At least one field must contain data."
}
}).data("kendoValidator");
});
Hello
I'm having some bad hours fiddling around with Kendo UI Upload to make what I want. Initially I wanted to restrict specific file types by "validation" parameter AND set the parameter "maxFileSize" depending on file type. This all with the autoupload feature (selecting one or more files). Something like:
.jpg, .png, .gif -> max 1 MB
.mp3 > max 5 MB
.mp4 -> max 10 MB
The world would have been perfect that way. As I was told: Both configuration parameter at the same time are not supported.
Just setting one parameter seems to work great and the Upload Widget does only upload the ones passing the set options.
Ok, one step back and doing own checks based on e.files while trying to use e.preventDefault(); in select event. Oh great, it prevents ALL files to be uploaded even the valid ones! Why can the Upload Widget itself differ between valid and invalid ones (in order to upload only the valid ones) while I - as programmer - have no chance to define which files are ready to upload and which are not?
Ok, one step back: I tried to remove invalid files from e.files in select event. Guess what: it doesn't matter what I do in here! The upload event has its own list and ignores any operation I have done inside e.files in select event.
Ok, one step back: where to?
All Kendo UI Widgets have their pros and cons. I'm using many and in some cases I had to and could find a workaround for what I wanted. But the Upload Widget is by far the worst, inconsistent and inflexible Widget in the list!
Hi,
We are using Kendo UI Menu in our SPA solution and we are getting some strange behavior from the Menu component. The menu is configured to expand and show all items when the mouse-over event is fired.The items are added based on an API call and contains all the projects users of the solution has access to. If a user changes project and then click on the menu before the menu is able to expand, and while the menu is still selected from the previous project change, the text from all items in the menu is appended and shown as the selected item.
This only happens in IE11 and Edge, if I try to set IE11 to behave as IE10 the issue goes away. Chrome works just fine. If I run this in the dev env. I am able to get the same "chain of events" in Chrome if I just browser sync and use IE for interaction.
When debugging I can see that the select event for the menu is supplied with an "e" object where the "e.item.textContent" property is set to the text from all the items in the datasource.
Have you encountered this before?

The column headers are displaying but no data from the JSON file I used in my source.
<div id="example"> <div id="grid"></div> <script> $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { type: "json", serverPaging: true, serverSorting: true, pageSize: 100, transport: { } }, height: 543, scrollable: { virtual: true }, sortable: true, columns: [ { field: "FirstName", title: "First Name", width: 100 }, { field: "LastName", title: "Last Name", width: 100}, { field: "Email", title: "Email", width: 50 }, { field: "Desk", title: "Desk", width: 50 }, { field: "Mobile", title: "Mobile", width: 50 }, { field: "Location", title: "Location", width: 110 } ] }); }); </script> <style> /*horizontal Grid scrollbar should appear if the browser window is shrinked too much*/ #grid table { min-width: 1190px; } </style> </div>
Maybe the JSON fine isn't properly formatted?

Hello,
I'm using the following code to export a grid with a few hundred rows:
kendo.drawing.drawDOM($("#resultsGrid"), { allPages: true, avoidLinks: true, paperSize: "A4", multiPage: true, landscape: true, margin: { top: "4cm", right: "1cm", bottom: "1cm", left: "1cm" }, repeatHeaders: true }).then(function (documentgroup) { kendo.drawing.pdf.saveAs(documentgroup, "myfile", "pdf")); });
The pdf settings on the grid look like this:
pdf: { allPages: true, repeatHeaders: true},
The grid exports fine but does not repeat the headers on each page. They are only present on the first page. Any ideas what would prevent "repeatHeaders: true" from repeating the headers on every page of the exported PDF file?
Thanks,
Jonesy

<!DOCTYPE html><html><head> <title></title> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.common-material.min.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.material.min.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.material.mobile.min.css" /> <script src="https://kendo.cdn.telerik.com/2017.1.223/js/jquery.min.js"></script> <script src="https://kendo.cdn.telerik.com/2017.1.223/js/kendo.all.min.js"></script></head><body> <div id="example"> <div id="editor" rows="10" cols="30" style="height:400px"> <br /> <br /> <p contenteditable="false"><span contenteditable="false">THIS WILL BE REMOVED ( NESTED CONTENT EDITABLE=FALSE)</span></p> <p>If you press Enter key when focus on this text the above will be removed.</p> </div> <script> $(document).ready(function() { $("#editor").kendoEditor({ immutables: true, tools: ["viewHtml"] }); }); </script> </div></body></html><style>
#filter-toolbar
{
display: inline-block;
padding: 5px;
}
</style>
<script>
$("#department-grid .k-grid-toolbar").prepend($("#filter-toolbar"));
</script>
<div id="department-grid"></div>
<div id="filter-toolbar"> <label>Company: </label> @Html.DropDownList("CompanyId", Model.CompanySelectList)</div><div id="department-grid"></div>
Hello,
I am trying to implement a complex grid that has 4 functions defined, on dataBound, columnMenuInit, and 2 on change. We noticed that, when using setOptions/getOptions from local storage, the functionality of our column menu is lost (an error about t[e] not being defined pops up).
Now, I have researched and apparently the JSON.stringify we have to apply before storing does away with the functions, this is, they are lost when setting the options to local storage: however, I was trying to implement a workaround I saw while researching, where basically the function was stored separately, and added after parsing the rest of the options before loading them to the grid again.
My problem now is that the function is getting added to the parsed options object as what I believe is an Unicode string (the representation of it on Chrome dev tools comes up as a string instead of a function). The error thrown when trying to JSON.parse it is that there's a "u" token at position 1, so that's what leads me to think in this way.
My question is: is there any way I can assign the function stored separately on local storage to grid options before applying them to the grid, in order to not lose any functionality? I would be happy just storing and re-adding the columnMenu function (I guess I could extend this to the other ones if it's possible, later on). What would be your advice in this case?
Thank you!
The className specified is applied on A tag but not on the right inner SPAN tag
try this code on dojo , see the attached screenshot
<!DOCTYPE html><html><head> <base href="http://demos.telerik.com/kendo-ui/grid/custom-command"> <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style> <title></title> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.common.min.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.blueopal.min.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.blueopal.mobile.min.css" /> <script src="https://kendo.cdn.telerik.com/2017.1.223/js/jquery.min.js"></script> <script src="https://kendo.cdn.telerik.com/2017.1.223/js/kendo.all.min.js"></script></head><body> <script src="../content/shared/js/people.js"></script> <div id="example"> <div id="grid"></div> <div id="details"></div> <script> var wnd, detailsTemplate; $(document).ready(function () { var grid = $("#grid").kendoGrid({ dataSource: { pageSize: 20, data: createRandomData(50) }, pageable: true, height: 550, columns: [ { field: "FirstName", title: "First Name", width: "140px" }, { field: "LastName", title: "Last Name", width: "140px" }, { field: "Title" }, { command: { text: "View Details", click: showDetails, className : 'k-icon k-i-copy' }, title: " ", width: "180px" }] }).data("kendoGrid"); wnd = $("#details") .kendoWindow({ title: "Customer Details", modal: true, visible: false, resizable: false, width: 300 }).data("kendoWindow"); detailsTemplate = kendo.template($("#template").html()); }); function showDetails(e) { e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr")); wnd.content(detailsTemplate(dataItem)); wnd.center().open(); } </script> <script type="text/x-kendo-template" id="template"> <div id="details-container"> <h2>#= FirstName # #= LastName #</h2> <em>#= Title #</em> <dl> <dt>City: #= City #</dt> <dt>Birth Date: #= kendo.toString(BirthDate, "MM/dd/yyyy") #</dt> </dl> </div> </script> <style type="text/css"> #details-container { padding: 10px; } #details-container h2 { margin: 0; } #details-container em { color: #8c8c8c; } #details-container dt { margin:0; display: inline; } </style> </div></body></html>