Telerik Forums
Kendo UI for jQuery Forum
0 answers
91 views
Hi,

I'm looking to validate date fields on a page, which is simple (see this JSBin from this thread).

BUT, when a page has multiple date fields on a page, things start to get wacky. See this JSBin and play around with invalid dates. The invalid message doesn't know which input to bind to, causing error messages on the wrong inputs.

Thanks for any help.

EDIT:

Simply instead of doing $("#MyForm").kendoValidator(...); targeting the date fields $(".datepicker").kendoValidator(...); resolved the issue.

Marking as 'answered'
Dan
Top achievements
Rank 1
 asked on 06 Jun 2013
1 answer
1.3K+ views
I have a trivial NumericTextBox in my application:
$("#number").kendoNumericTextBox({
    format: "c0",
    decimals: 2,
    spinners: false
});
I have an event handler elsewhere that tries this:
function updateNumber() {
    var numberBox = $("#number").data("kendoNumericTextBox");
    var anothernumberBox = $("#anotherNumber").data("kendoNumericTextBox");
    var yetanothernumberBox = $("#yetanotherNumber").data("kendoNumericTextBox");
    try {
        numberBox.value(anothernumberBox.value() - yetanothernumberBox.value());
    }
    catch (err) {
        //
    }
};
This works great as long as the number that numberBox.value() is set to is positive.
If the number is negative it fails.

I've tried messing with the min on the numberBox with no improvement.

How can I set the value() property on a NumericTextBox to a negative value?
DJo
Top achievements
Rank 1
 answered on 06 Jun 2013
4 answers
268 views
There's a strange margin declaration in the 2013.1.514 build that's causing my css parser to fail.
.k-menu .k-animation-container,
.k-popup .k-animation-container {
  margin-top: -1px;
  margin-top: -2px\9;
  padding-left: 1px;
}
margin-top: -2px\9;
And the less declaration:
.k-menu .k-animation-container,
.k-popup .k-animation-container
{
    margin-top: -1px;
    margin-top: ~"-2px\9";
    padding-left: 1px;
}

Ryan
Top achievements
Rank 1
 answered on 06 Jun 2013
2 answers
204 views
 want to include a tooltip in template.

<script id="filter-panel-tpl" type="text/x-kendo-template">
<div>
    # if (Type == Single){ #
        <div class="hight-light-box" >
            <div id="name-#= Id#-@ViewBag.Uid" class="small-size-icon icon-margin-right-5" style="float:right;"></div>
            #= Name #
        </div>
    # }else{ #
        <div class="hight-light-box" >
            <div id="name-#= Id#-@ViewBag.Uid" class="small-size-icon edit-icon icon-margin-right-5" style="float:right;" data-bind="click: onEdit"></div>
            #= Name #
        </div>
    # } #
    @(Html.Kendo().Tooltip()
                .For("#name-#= Id#-" + ViewBag.Uid)
                .Width(300)
                .Height(450)
======>  .LoadContentFrom("Index", "Search", new { searchType ="#=Name#" })
                .Position(TooltipPosition.Right)
                .ShowOn(TooltipShowOnEvent.Click)
                .AutoHide(false)
                .ToClientTemplate()
         )
</div>
</script>

In Search Controller, I set a break point in Index(string name). The value for name is "#=Name#", not the value of "Name" field from data model. The rendering for <div> part is working though. Can someone please take a look at this?

Thanks.

Yuhua
Top achievements
Rank 1
 answered on 06 Jun 2013
3 answers
127 views
Is anyone else seeing any warnings when opening a solution with VS2010 and Kendo?  I get the following when launching a solution:
Failed to query command status: System.Runtime.InteropServices.COMException <br>(0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) at <br>EnvDTE._DTE.get_ActiveSolutionProjects() at <br>Telerik.VSX.Internal.ProjectManagement.ProjectRetriever.GetFirstSelectedProject(DTE <br>dte) at <br>Telerik.VSX.Internal.ProjectManagement.ProjectWrapFactoryBase`1.GetForFirstSelectedProject(DTE <br>dte) at <br>Telerik.KendoUI.Mvc.VSPackage.CommandStateController.GetState(OleMenuCommand <br>menuCommand, DTE dte) at <br>Telerik.VSX.CommandStateResolving.CommandStateControllerBase.GetAsyncState(OleMenuCommand <br>menuCommand, DTE dte) at <br>Telerik.VSX.VSPackage.PackageBase.MenuCommand_BeforeQueryStatus(Object sender, <br>EventArgs e)
It only appears as a warning in the ActivityLog but I've also had VS2010 crash on me which is why I'm investigating.  Any assistance would be appreciated.  Thanks!
Teodor
Telerik team
 answered on 06 Jun 2013
14 answers
768 views
So I am following the kendo examples for using a Grid with a nested TabStrip with a Grid within the tab.  The problem I am having is that the TabStrip is rendering above the Grid instead of within the detailtemplate.  I have attached a screenshot to demonstrate the error.

The main difference between my code and the kendo example is that my main grid and the grids with the tabs are editable.

Here is my view code:
@model IEnumerable<PASSLibrary.Laboratory>
 
@{
    ViewBag.Title = "Laboratories";
}
 
<h2>Laboratories</h2>
 
@(Html.Kendo().Grid(Model)
    .Name("gvLaboratories")
    .Columns(columns =>
    {
        columns.Command(command => { command.Edit(); }).Width(50);
        columns.Bound(l => l.ID);
        columns.Bound(l => l.Description);
        columns.Command(command => { command.Destroy(); }).Width(50);
    })
    .DetailTemplate(l =>
    {
        Html.Kendo().TabStrip()
            .Name("ts" + l.ID)
            .SelectedIndex(0)
            .Items(items =>
            {
                items.Add().Text("Lab Admins").Content(@<text>
                    @(Html.Kendo().Grid(l.Users_Roles)
                        .Name("gvLabAdmins" + l.ID)
                        .Columns(columns =>
                        {
                            columns.Bound(a => a.User_ID).Title("User ID");
                            columns.Bound(a => a.User.Account).Title("BNL Account");
                            columns.Command(command => { command.Destroy(); }).Width(50);
                        })
                        .ToolBar(toolbar => toolbar.Create())
                        .Sortable()
                        .DataSource(dataSource => dataSource
                            .Server()
                            .Model(model => model.Id(a => a.User_ID))
                            .Create(create => create.Action("AddLabAdmin", "SystemAdmin"))
                            .Destroy(destroy => destroy.Action("DeleteLabAdmin", "SystemAdmin"))
                        )
                    )
                </text>);
                items.Add().Text("Facilities").Content(@<text>
                    @(Html.Kendo().Grid(l.Facilities)
                        .Name("gvFacilities" + l.ID)
                        .Columns(columns =>
                        {
                            columns.Bound(f => f.ID);
                            columns.Bound(f => f.Description);
                            columns.Command(command => { command.Destroy(); }).Width(50);
                        })
                        .ToolBar(toolbar => toolbar.Create())
                        .Sortable()
                        .DataSource(dataSource => dataSource
                            .Server()
                            .Model(model => model.Id(f => f.ID))
                            .Create(create => create.Action("AddFacility", "SystemAdmin"))
                            .Destroy(destroy => destroy.Action("DeleteFacility", "SystemAdmin"))
                        )
                    )                   
                </text>);
            })
            .Render();
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp).Window(window => window.HtmlAttributes(new { @style = "width:700px;" })))
    .Pageable()
    .Sortable()
    .DataSource(dataSource => dataSource
        .Server()
        .Model(model => model.Id(l => l.ID))
        .Create(create => create.Action("AddLaboratory", "SystemAdmin"))
        .Read(read => read.Action("Laboratories", "SystemAdmin"))
        .Update(update => update.Action("UpdateLaboratory", "SystemAdmin"))
        .Destroy(destroy => destroy.Action("DeleteLaboratory", "SystemAdmin"))
    )
)
Stephen
Top achievements
Rank 1
 answered on 06 Jun 2013
2 answers
190 views
Hi,
i need to drag from list and drop to grid, but i have problem with refreshing grid list:

This is code:
<!DOCTYPE HTML>
<html>
<head>
<title>Your Website</title>

<link href="styles/kendo.common.min.css" rel="stylesheet">
<link href="styles/kendo.default.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/kendo.web.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<style>
html,body {
       padding:0;
       margin:0;
       height:100%;
       max-height:100%;
     }
.articles-list, .articles-grid {
border: 1px solid #CCC;
height: 40%
}
#list {
padding: 10px
}
#grid {
height: 200px;
background: #FF0;
}
.product {
   float: left;
   position: relative;
   width: 111px;
   height: 170px;
   margin: 0;
   padding: 0;
}
.product img {
   width: 110px;
   height: 110px;
}
.product h3 {
   margin: 0;
   padding: 3px 5px 0 0;
   max-width: 96px;
   overflow: hidden;
   line-height: 1.1em;
   font-size: .9em;
   font-weight: normal;
   text-transform: uppercase;
   color: #999;
}
.k-listview:after, .product dl:after {
   content: ".";
   display: block;
   height: 0;
   clear: both;
   visibility: hidden;
}

</style>
</head>
<body>


<ul id="menu" data-role="menu" class="k-widget k-reset k-header k-menu k-menu-horizontal" tabindex="0" role="menubar">
<li class="k-item k-state-default k-first" role="menuitem">
<span class="k-link">Menu item</span>
</li>
</ul>

<div class="articles-list">
<div id="list"></div>
</div>

<div class="articles-grid">
<div id="grid"></div>
</div>


    <script type="text/x-kendo-tmpl" id="template">
        <div class="product">
            <img src="http://placehold.it/100x100" alt="${name} image" />
            <h3>#:name#</h3>
            <input type="hidden" value="#:id#">
        </div>
    </script>

<script>
        $(document).ready(function() {
        var list = $("#list");
var grid = $("#grid");

            var data = [
            { id: 1, name: "Jane Doe", quantity: 30 },
    { id: 2, name: "John Doe", quantity: 33 }
            ];

            var grid_data = new kendo.data.DataSource({
   data: []
});

            list.kendoListView({
                dataSource: data,
                template: kendo.template($("#template").html())
            });

            grid.kendoGrid({
            dataSource: {
            data: []
            },
                sortable: true,
                columns: [ {
                        field: "name",
                        width: 90,
                        title: "Naziv"
                    } , {
                        field: "quantity",
                        width: 90,
                        title: "Kolicina"
                    }
                ]
            });

            list.kendoDraggable({
            filter: ".product",
                hint: function(row) {
                    return row.clone();
                }
            });

            grid.kendoDropTarget({
            drop: function(row) {
            var tempData = row.draggable.currentTarget.context.children;
            grid_data.add({ id: tempData[2].value, name: tempData[1].innerHTML, quantity: '2' });
            }
            });
        });
    </script>
</body>
</html>


Can you tell me if this is correct way doing it, and how should i refresh grid on drop?
Mirza
Top achievements
Rank 1
 answered on 06 Jun 2013
1 answer
107 views
Is there a way to get editor value without the html tags, such as a kendoEditor.text() field?
Alexander Valchev
Telerik team
 answered on 06 Jun 2013
9 answers
145 views
Hi,

I'm having dates coming from JSON datasource and are being set as categoryAxis, but they get shuffled automatically, i.e; somehow the middle date is showing as the first field and vice versa. Please find the attached screenshot for detail.
I don'nt konw why is it happening, Please help!
Iliana Dyankova
Telerik team
 answered on 06 Jun 2013
6 answers
140 views
I would like to create a plotband on both the x-axis and y-axis on a bubble chart. The plotband seems to work fine on the x-axis, but the chart will not accept on the y-axis...regardless if there's one on the x-axis or not.

Is it possible to put a plotband on the y-axis with a bubble chart and how would I go about doing it? I'm on v.2012.2.710
Thanks
Iliana Dyankova
Telerik team
 answered on 06 Jun 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
Chat
DateRangePicker
Dialog
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?