Telerik Forums
Kendo UI for jQuery Forum
3 answers
397 views
Hi there...

I have a strongly typed partial view that utilizes attribute based validations on the view model properties. In addition to the data annotation validation I need to make an asynchronous call to the web server to validate some info on the fly. If the response is false (indicating an incorrect value) I just want to display the "validation bubble" that informs the user of an incorrect entry. The true/false value is coming back correctly from the server but it is not raising the validation bubble if false.

<div id="datatovalidate">
    <div class="float-left editor-label">
        @Html.LabelFor(model => model.ProductCode)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.ProductCode, new { @class = "k-textbox" })
    </div>
    <div class="clear"></div>
</div>

$('#datatovalidate').kendoValidator({
        rules: {
            InvalidProdCode: function (input) {
                var isValid = true;

                if (input.is('[id=ProductCode]')) {
                    $productCode.val($productCode.val().toUpperCase());

                    if ($isPidx.prop('checked')) {
                        $.post('@UrlMaker.ToValidateProductCode()' + $productCode.val(), function (data) {
                            isValid = data;
                        });
                    }
                }

                return isValid;
            }
        },
        messages: {
            InvalidProdCode: "Invalid Product Code"
        }
    });
Matt
Top achievements
Rank 1
 answered on 08 Feb 2013
2 answers
183 views
I'm trying to use kendo mvvm to solve the following problem: I have 3 dropdown lists, and I need that the option selected in one dropdown doesn't appear in the other two.
I got that working, but if you start changing options in the dropdowns sometimes the displayed value in one of the dropdowns changes without any reason. For example, if I select "grapes" in the first dropdown, and then I start playing with the dropdown 2 (change it to mango, then apple, then mango and so on) the dropdown 1 display changes from "grapes" to something else (even though the value in the view model is still "grapes").

I prepared a jsbin with my code http://jsbin.com/ebuhaq/1/edit
dmorgan
Top achievements
Rank 1
 answered on 08 Feb 2013
6 answers
968 views
I am trying to set up a call using the datasource control in a html page, based on the following:

http://docs.kendoui.com/api/framework/datasource#transportcreatedata-objectstringfunction

Below is my js function call, and what I am trying to so is pass the customer header called "key" with the value to my restful service, and not sure if I am doing this correctly or not, I am assuming not as I am not seeing this value in my service. So any help you can give on this would be appreciated. Thanks.
function mobileListViewPressToLoadMore() {
       var dataSource = new kendo.data.DataSource({
           pageSize: 20,
           serverPaging: true,
           transport: {
               create: {
                   data: { key: "34083E61DB18E3E88C80DB638C91009A9934757542B538C20E332BBC3F079BE66E79BDC70F06EED8541925D95599E834CF8877D07FAF4645A190BFA3E38A9A3FCB728E043EB8A081B279B81F6F9CED5A"
                   }
               },
               read: {
                   url: "http://services/rest/plan.svc/Patient" // the remove service url
 
 
               },
 
               parameterMap: function (options) {
                   var parameters = {
                       q: "javascript", //additional parameters sent to the remote service
                       rpp: options.pageSize,
                       page: options.page //next page
                   };
 
                   return parameters;
               }
           }, schema: { // describe the result format
               data: "", // the data which the data source will be bound to is in the "results" field
               total: function () { return 0; }
           }
       });
 
       $("#load-more").kendoMobileListView({
           dataSource: dataSource,
           template: $("#load-more-template").text(),
           loadMore: true
       });
 
   }
JD
Top achievements
Rank 1
 answered on 08 Feb 2013
1 answer
134 views
I am trying to make a line chart where the categoryAxis has a baseUnit of "month".

The data is an array of objects

[0].price = 34
[0].priceDate = javascriptDate

The data bind and the chart is there but it looks like a bunch of points with none of them connected by a line. OR depending on the data, some points are connected.


$("#previewChart").kendoChart({
                theme: "blueOpal",
                title: {
                    text: customDataViewModel.CustomDataName
                },
                legend: {
                    visible:false
                },
                chartArea: {
                    width: 680,
                    height:380
                },
                plotArea: {
                    margin: { bottom: 10, right: 100}
                },               
                dataSource: wth,
                series: [{
                    type:"line",
                    field: "price"
                }],
                categoryAxis: {
                    type: "date",
                    field: "priceDate",
                    baseUnit: "month",
                    labels: {
                        format: "MMM/yy",
                        title:"",
                        rotation:-90
                    }
                },
                valueAxis: {
                    
                },
                tooltip: {
                    visible: true,
                    template: "Price: #= value #<br/>Date: #= kendo.toString(category, 'MMM/yyyy') #"
                }
            });                        
        });      

I need every point to show and for them to be connected by a line.

Iliana Dyankova
Telerik team
 answered on 08 Feb 2013
1 answer
113 views
hi guys
Had problems when I try to filter a date column type.

Project code attached and this is the video error http://www.screencast.com/t/UggvI7Ji

thank you very much

Daniel
Telerik team
 answered on 08 Feb 2013
2 answers
476 views
I have some odd behavior happening in a combo box.

I have a simple combo box setup.

@(Html.Kendo().ComboBox()
                  .Name("vendorsforClass")
                  .AutoBind(false)
                  .HtmlAttributes(new { style = "width: 300px;" })
                  .DataTextField("Name")
                  .DataValueField("Id")
                  )
I have a link button that calls this javascript code.

function getVendorsForClass() {
 
        var txtValue = $("#txtSearchClassVendor").val();
 
        $.getJSON('@Url.Action("GetVendorListByClass","RCS", new {classes = "class"}, "http")/' + txtValue, function (data) {
 
            var combo = $("#vendorsforClass").data("kendoComboBox");
            combo.setDataSource(data);
            combo.refresh();
        });
}
This is the code in the controller that is creating the json object.

public JsonResult GetVendorListByClass(string classes)
        {
            var vendors = new List<VendorList>();
 
            var classId = classes.Split('/')[1];
 
            int outId;
            if (int.TryParse(classId, out outId))
            {
                vendors = new VendorListFactory().GetVendors(outId);
            }
 
            return this.Json(vendors.Select(v => new { v.Name, v.Id }), JsonRequestBehavior.AllowGet);
        }
Everything works perfectly on the first time I click on the link to populate the combo box.  If I select a value in the combo box, say for example it's Id happens to be 1234, when I click on the link again (with the intention of repopulating the combo box with different set of values) with a different value that returns back an empty object (no results in the list), the combo box is left with no values in the drop down (which would be correct), but the text in the combo box say 1234.

The box is left with the Id on the previous value I selected.  I thought when I call setDataSource it rebinds the combo box, meaning it removes previously selected values.  Why is the combo box setting it's text as the previous value (Id) that I had selected when the second datasource happens to be an empty list?

Thanks,
Tad
TAD RHODES
Top achievements
Rank 1
 answered on 08 Feb 2013
2 answers
99 views
I have a listview where each item has a 2 divs, one with info and a second with a form, the form is hidden but when I tap the item it uses kendo.fx.expand to slide the drawer down and display the form, this part works perfectly, but when I change the input and move focus it resets the display:none on the parent div and hides it. I have no events set on the input to trigger this. And all my debug ideas so far have yielded no results.

Just a regular onblur does nothing (the div stays as it should), the problem only appears on change + blur. I've tried overriding the onchange and onblur events thru direct declaration in the input using "return false;" and using data-bind="events: {blur: ..., change: ...}" .

I also tried using jquery.slideToggle and get the same result.

Attached is a sample project that demonstrates the problem.

Any ideas on what I am doing wrong or could change?
JT
Top achievements
Rank 1
 answered on 08 Feb 2013
1 answer
622 views
I have 2 grids displayed on one page, our top Grid allows editing with a custom edit command.  Our lower grid allows for inline editing.  I want the ability to disable the top grid's custom Edit function (Edit button) when I click in the lower grid for inline editing using jQuery.  Below is what I have attempted

            $(function () {
                $(document).ready(function () {
                    var inlineEdit = $("#kendoGrid").data().kendoGrid.select().is(".k-grid-edit-row");
                        if (inlineEdit > 0) {
                            var edit = $("#kendoGrid").data("kendoGrid").find("k-grid-edit");
                            edit.hide();
                            e.preventDefault();
                            return false;
                       }
   });
                });
Iliana Dyankova
Telerik team
 answered on 08 Feb 2013
1 answer
112 views
Hi,

I have two questions regarding the kendo stock chart:

1. I need to retrieve a list of the currently displayed data points (not the whole data set of the series) in the events zoomEnd, dragEnd and selectEnd in order to perform some normalization. How can this be done?

2. For the same events, how do I get the min and max of the currently displayed range of the x axis?

Thanks.
Iliana Dyankova
Telerik team
 answered on 08 Feb 2013
1 answer
166 views
I can't get the touch demo on the site to work. I copied the source, but I can't get it running. This is my code:

<!DOCTYPE html>
<html>
<head>
    <title>Voiss</title>
     
    <script src="Scripts/kendo/last/jquery.min.js"></script>
    <script src="Scripts/kendo/last/kendo.all.min.js"></script>
    <link href="Content/kendo/last/kendo.common.min.css" rel="stylesheet" type="text/css" />
    <link href="Content/kendo/last/kendo.default.min.css" rel="stylesheet" type="text/css" />
    <link href="Content/kendo/last/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
     
</head>
 
<body>
    <div data-role="view" data-title="Touch Events">
 
    <div
        id="touchSurface"
        data-role="touch"
        data-enable-swipe="1"
        data-touchstart="myTouch.touchstart"
        data-swipe="myTouch.swipe"
        data-tap="myTouch.tap"
        data-doubletap="myTouch.doubletap"
        data-hold="myTouch.hold"
        >
    Touch, swipe, double-tap, tap, and hold me
</div>
<div class="console"></div>
</div>
 
<script>
    window.myTouch = {
        touchstart: function(e) { kendoConsole.log("touch start"); },
        swipe: function(e) { kendoConsole.log("swipe " + e.direction); },
        tap: function(e) { kendoConsole.log("tap"); },
        doubletap: function(e) { kendoConsole.log("double tap"); },
        hold: function(e) { kendoConsole.log("hold"); }
    }
</script>
 
<style scoped>
    #touchSurface {
        background: black;
        color: white;
        padding: 20px;
        line-height: 20em;
        text-align: center;
        font-style: italic;
    }
</style>
 
 
<script>
    var app = new kendo.mobile.Application(document.body);
</script>
</body>
</html>

The js and css files are the latest, but it fails to run, both on my browsers (chrome, firefox, ie) as my tablet (android)
Martijn
Top achievements
Rank 1
 answered on 08 Feb 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
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
MultiColumnComboBox
Dialog
Chat
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?