Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.9K+ views
Hello,

I have added required field validation on textbox. The validation works on blur event and displays a warning message, but when i click on a Save button the warning is not displayed. I am calling validator.validate() method on button click. Below is the code.

var validator = $(divOrgUNitDetailView).kendoValidator({
            rules: {
                required: function (input) {
                    if (input.is(txtOrgName))
                        return input.val() != "";
                    return true;
                }
            },
            errorTemplate: '<span class="field-validation-error"> ${message}</span>'
        }).data("kendoValidator");

and on button click i am calling, 
if(validator.validate()){}

Thanks,
Sushant
Rosen
Telerik team
 answered on 02 Aug 2013
4 answers
104 views
Hello
I have problem with tabstrip in recent available version 2013.2.716. I've downloaded this version to use new flat skin, but tab strip is now unusable. It is not selecting tab after first click. (it performs navigation, but not indicate state) Second click is not performing navigation (already done) and fix state. Please look at aattached example.
Kamen Bundev
Telerik team
 answered on 02 Aug 2013
1 answer
478 views
I have a grid with a Country (ID, Name) and a DropDownList for a list of presidents. The drop down list needs to filter based on the Country. This far I have gotten, however I can't use ViewData because the list is dynamic based on the country and the # of presidents is large.

My problem...
When the grid first loads and there is a PresidentID in the row  - the President's name is not visible, only the PresidentID

Note that PresidentID is a nullable int!


The ViewModel
public class CountryViewModel
{
    public int CountryID { get; set; }
    public string CountryName { get; set; }
 
    [UIHint("Presidents")]
    public int? PresidentID { get; set; }
}

Simplified Grid
@(Html.Kendo().Grid<CountryViewModel>()
  .Name("CountriesGrid")
  .Columns(c =>
               {
                   c.Bound(x => x.CountryName)
                   c.Bound(x => x.PresidentID)
                       .EditorTemplateName("Presidents")
               })
  .Editable(e => e.Mode(GridEditMode.InCell))
  .Events(x => x.Edit("onEdit"))
  .DataSource(ds => ds
        .Ajax()     
        .ServerOperation(false)
        .AutoSync(true)
        .Model(m =>
            {
            m.Id(x => x.CountryID);
            m.Field(x => x.CountryID).Editable(false);
            m.Field(x => x.PresidentID).DefaultValue(1);
            })
        .Read(r => r.Action("GetCountries", "Country"))
        .Update(u => u.Action("UpdateCountry", "Country"))
  ))

JavaScript on the same view as the grid...
<script>
function getCountryID() {
        var row = $(event.srcElement).closest("tr");
        var grid = $(event.srcElement).closest("[data-role=grid]").data("kendoGrid");
        var dataItem = grid.dataItem(row);
 
        return { CountryID: dataItem.CountryID }
    }
     
//for InCell edit mode
function onEdit(e) {
     var dropDown = e.container.find("[data-role=dropdownlist]").data("kendoDropDownList");
        if (dropDown) {
            dropDown.bind("change", function(e) {
                var grid = e.sender.wrapper.closest(".k-grid").data("kendoGrid");
                var dataItem = grid.dataItem(e.sender.wrapper.closest("tr"));
 
                //If current value is null
                if (!dataItem.PresidentID) {
                    //change the model value
                    dataItem.PresidentID = 0;
                    //get the currently selected value from the DDL
                    var currentlySelectedValue = e.sender.value();
                    //set the value to the model
                    dataItem.set('PresidentID', currentlySelectedValue);
                }
            });
        }
    }
 
</script>



Presidents.cshtml template file...
@(Html.Kendo().DropDownListFor(m => m)
        .DataValueField("ID")
        .DataTextField("Name")
        .AutoBind(true)
        .OptionLabel("Select...")
        .DataSource(ds => ds.Read(r => r.Action("GetPossiblePresidents", "Country")
            .Data("getCountryID()"))
            )
       )


Please help - I've been at this for hours

Nick Gerne
Top achievements
Rank 1
 answered on 02 Aug 2013
3 answers
97 views
Hello,
I am getting a strange error when I use KendoGrid (Angular). The following is the stack trace. Can some one please let me know whats going on?

Thanks
Matt'M

TypeError: Object function JQLite(element) {
if (element instanceof JQLite) {
return element;
}
if (!(this instanceof JQLite)) {
if (isString(element) && element.charAt(0) != '<') {
throw Error('selectors not implemented');
}
return new JQLite(element);
}

if (isString(element)) {
var div = document.createElement('div');
// Read about the NoScope elements here:
// http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
div.innerHTML = '<div>&#160;</div>' + element; // IE insanity to make NoScope elements work!
div.removeChild(div.firstChild); // remove the superfluous div
JQLiteAddNodes(this, div.childNodes);
this.remove(); // detach the elements from the temporary DOM div.
} else {
JQLiteAddNodes(this, element);
}
} has no method 'extend'
at gatherOptions (http://localhost:3000/no_npm_vendor/kendo/angular-kendo.js:39:35)
at Object.create (http://localhost:3000/no_npm_vendor/kendo/angular-kendo.js:107:19)
at http://localhost:3000/no_npm_vendor/kendo/angular-kendo.js:164:36
at <error: illegal access>
at completeOutstandingRequest (http://localhost:3000/vendor/angular/angular.js:3041:10)
at http://localhost:3000/vendor/angular/angular.js:3327:7 angular.js:5754(anonymous function)angular.js:5754(anonymous function)angular.js:4846(anonymous function)angular.js:9476completeOutstandingRequestangular.js:3041(anonymous function)
Burke
Telerik team
 answered on 02 Aug 2013
5 answers
135 views
If Kendo cannot find a route, method "routeMissing" is called. When that method gets executed, the URL has already changed. What can be done, so the current view and the browser's URL do not change?

I tried to call preventDefault on the event object, as can be done in the change event. However, that did not work.

Michael G. Schneider
Zachary
Top achievements
Rank 1
 answered on 01 Aug 2013
1 answer
232 views
Hi,

We have a grid with many columns with editor templates defined. We also have many custom validations based on the values of these columns.

eg. One column is a drop down with Status and another column is a datepicker with Date.

When we change the Date we want to check the value of the Status dropdown in the custom validation. How can we do this?

Currently when we change the status from StatusOne to StatusTwo, and then change the date field we need to be able to access the current value of StatusID for that row. But it shows the old value of StatusID (StatusOne) when we try to access it via the grid instead of StatusTwo.

                        var gd = $('#gds').data("kendoGrid");
                        var inputName = input.attr("id");
                        var rowIndex = input.context.rowIndex;
                        var StatusID = gd._data[rowIndex].StatusID;

Please let us know how to access the current value.

Thanks,

Sherly
Greg
Top achievements
Rank 1
 answered on 01 Aug 2013
0 answers
173 views
When I give the scheduler event the startTime of "Thu Aug 01 2013 11:00:00 GMT-0700 (Pacific Daylight Time)" the scheduler shows the time as 6PM.

When I give it "Thu Aug 01 2013 18:00:00 GMT-0700 (Pacific Daylight Time)" it shows as 1AM.

I don't know what I am doing wrong, how do I tell the scheduler to show it in the time I want (which is 11AM PST).


UGH - I figured it out, the example had the timezone set:
timezone: "Etc/UTC",
Aaron
Top achievements
Rank 1
 asked on 01 Aug 2013
1 answer
160 views
Hi,
Web page is  freezes when data
is binding to chart. We are using kendoui version “Kendo UI Complete
v2012.2.710”.
Please advise.

Iliana Dyankova
Telerik team
 answered on 01 Aug 2013
5 answers
238 views
When using Firefox, if I set the Font and/or Size, then type a line, the font/size is honored.  As soon as I hit enter the new line being created goes back to the inherited font and size.
Alex Gyoshev
Telerik team
 answered on 01 Aug 2013
1 answer
156 views
We are using Kendo v2013.2.716. I have a simple Treeview on a page, and I have it linked to an onDrop function. In the function, I am checking to make sure the drop is allowed. If it is not allowed, I use e.setValid(false) like you guys have described elsewhere to do. I have confirmed that the e.setValid(false) statement is actually hit. But after I do this, I run console.log(e.valid) , and it seems to still be showing e.valid as true, even though I set it to false. Is this me misunderstanding how it works? Do I need to track an additional isValid variable myself? Just would have figured e.valid would keep the updated validity status. Thanks.
Alex Gyoshev
Telerik team
 answered on 01 Aug 2013
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
Drag and Drop
Application
Map
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
Licensing
ScrollView
Switch
TextArea
BulletChart
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
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?