Telerik Forums
Kendo UI for jQuery Forum
1 answer
114 views
I have several views in my Kendo Mobile app and I use buttons and navigate function to navigate between the views.
Each view contains several input elements.

How do i select the first input element to be focused after the view is navigated to?

I have tried the follownig, but it does not focus on the input after the view is navigated to.

application.navigate('#loan-promotion-length');
$('#field-promotion-length').focus();
Alex
Top achievements
Rank 1
 answered on 11 Jun 2014
1 answer
225 views
Hello,  I am trying to figure out how to create an aggregate row on a grid when you group by any column.  I have created a demo of this using the regular kendo javascript. 

http://jsfiddle.net/UHzcw/44/

However, our solution uses the mvc helpers so I'll need to be able to use that but I can't figure out how to do it.  Here is our current code that we will be adding this to.  What are we missing here?  How do you add the aggregates to each column in mvc like in the javascript version?

 @(Html.Kendo().Grid<ReportListViewModel>()
                            .Name("ReportList")
                            .HtmlAttributes(new { @class = "cursorLink" })
                            .DataSource(ds => ds.Ajax()
                                .Aggregates( a => {
                                    a.Add(p => p.ReportName).Count();
                                    a.Add(p => p.ReportCategoryName).Count();
                                    a.Add(p => p.User_CreatedBy).Count();
                                    a.Add(p => p.CreatedDate).Count();
                                    a.Add(p => p.ReportDescription).Count();
                                })
                                .Read("ReportListData", "Reports", new { ProductName = ViewBag.SelectedProduct.ProductName })
                                .PageSize(500))
                                
                            .ToolBar(toolbar =>
                                {
                                    toolbar.Template(@<text>
                                       <div class="toolbar">
                                       <span class="">
                                           <a class="btn btn-small printGridButton"><i class="icon-print"></i>Print</a>
                                           <a class="btn btn-small saveGridButton" id="SaveReportList" data-mcpagename="ReportList" data-mcuserconfigsettingid="@reportListGridUserConfigId" data-mcuserconfigsettingname="ReportList" data-mcuserconfigshowpagemessage="true"><i class="icon-hdd"></i>Save View</a>
                                           <a class="btn btn-small resetGridButton" data-mcuserconfigsettingname="ReportList" data-mcuserconfigshowpagemessage="false"><i class="icon-repeat"></i>Reset View</a>
                                       </span>
                                       </div>
                                    </text>);
                                })
                            .Columns(c =>
                            {
                                c.Bound(f => f.ReportName).Title("Report Name").ClientTemplate("<input type='hidden' id='GridRowURL' value='" + Url.Action("ReportView") + "/#=ReportId#' />#:data.ReportName#").Width(300).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.ReportCategoryName).Title("Category").Width(125).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.User_CreatedBy).Title("Created By").Width(150).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.CreatedDate).Title("Date Created").Width(120).Format("{0:d}").HtmlAttributes(new { @class = "kendoGridDate" }).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.ReportDescription).Title("Description").ClientFooterTemplate("#=count#");
                                //c.Template(f => { }).ClientTemplate("#if (data.ReportSubscriptionId > 0) {# <a class='btn btn-mini' href='javascript:void(0)' onclick='updateReportSubscription(#=ReportSubscriptionId#, \"#=ReportId#\")'><i class=\"icon-pencil\"></i>Edit</a> #} else {# <a class='btn btn-mini' href='javascript:void(0)' onclick='addReportSubscription(\"#=ReportId#\")'><i class=\"icon-plus\"></i>Add</a> #}#").Title("Subscribe").HtmlAttributes(new { @class = "mc_reportSubscriptionCell" }).Width(90);
                            })
                            .Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
                            .Groupable(g =>
                            {
                                g.Messages(m =>
                                {
                                    m.Empty("Drag Column Header Here to Group");
                                }
                                );
                            }
                            )
                            .Pageable(p =>
                            {
                                p.Input(true).Numeric(false);
                                p.PageSizes(new int[] { 250, 500, 1000, 2500, 5000 });
                            })
                            .Filterable(filterable =>
                                filterable.Operators(operators => operators
                                    .ForString(str => str.Clear()
                                        .Contains("Contains")
                                        .DoesNotContain("Does not contain")
                                        .IsEqualTo("Is equal to")
                                        .IsNotEqualTo("Is not equal to")
                                        .StartsWith("Starts with")
                                        .EndsWith("Ends with ")                                
                                    )
                                )
                            )
                            .AutoBind(false)
                            .ColumnMenu()
                            .Events(e => e.DataBound("OnDataBoundReportList"))
                            .Scrollable(builder => builder.Enabled(true).Height("500px"))
                            .Reorderable(r => r.Columns(true))
                        )
Daniel
Telerik team
 answered on 11 Jun 2014
1 answer
847 views
HI,

The Required field validation some times showing below the fields and for some fields beside the text box properly.Please find the attachment.
 
I have two fields State and Zip fields configured as below. Inspected items of the both the fields looks as below.
//State ComboBox
<td>
<span class="k-widget k-combobox k-header" style="width: 180px;">
<span class="k-dropdown-wrap k-state-default" unselectable="on" tabindex="-1">
<input class="k-input" type="text" autocomplete="off" name="State_input" style="width: 100%;" role="combobox" aria-expanded="false" placeholder="Select..." tabindex="0" aria-disabled="false" aria-readonly="false" aria-autocomplete="list" aria-owns="State_listbox" aria-busy="false" aria-activedescendant="State_option_selected">
<span class="k-select" unselectable="on" tabindex="-1">
<span class="k-icon k-i-arrow-s" unselectable="on" role="button" tabindex="-1" aria-controls="State_listbox">select</span>
</span>
</span>
<input id="State" class="k-invalid" style="width: 180px; display: none;" validationmessage="This is a required field." required="required" data-value-primitive="true" data-bind="value:State.Code" name="State" data-role="combobox" aria-disabled="false" aria-readonly="false" aria-invalid="true">
<div class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" style="margin: 0.5em;" data-for="State" role="alert">
<span class="k-icon k-warning"> </span>
This is a required field.
<div class="k-callout k-callout-n"></div>
</div>
</span>
</td>
 
//ZIp text Box
<td>
<input id="Zip" class="k-input k-textbox k-invalid" type="Zip" style="width:180px;" validationmessage="This is a required field." required="required" maxlength="10" data-bind="value:Zip" name="Zip" aria-invalid="true">
<div class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" style="margin: 0.5em;" data-for="Zip" role="alert">
<span class="k-icon k-warning"> </span>
This is a required field.
<div class="k-callout k-callout-n"></div>
</div>
</td>

This is how I have configured both the fields on popup Template

 <tr>
  <td>
<
input type="text" id="City" class="k-input k-textbox" name="City" data-bind="value:City"  maxlength="30" required="required" validationMessage="This is a required field." style="width:180px;"/>    
  </td>
</tr>                           
 <tr>
      <td>
<input id="State" name="State"  data-bind="value:State.Code"  data-value-primitive="true"  required="required" validationMessage="This is a required field." style="width: 180px;" />
  </td>
</tr>
 <tr>
    <td>
<input type="Zip" id="Zip" class="k-input k-textbox" name="Zip" data-bind="value:Zip" maxlength="10" required="required" validationMessage="This is a required field." style="width:180px;" />
<span data-for="Zip" class="k-invalid-msg"></span>
 </td>
</tr>

Styles we have for server validation messages.
.k-tooltip-validation.k-invalid-msg
{
    display:inline-block;   
}
  
.k-invalid-msg .k-callout
{
       display:none;
}

State Combobox
$("#State").kendoComboBox({
          placeholder: "Select...",
          dataTextField: "Code",
          dataValueField: "Code",
          headerTemplate: '<div class="dropdown-header">' +
                               '<span class="k-widget k-header">Code</span>' +
                               '<span class="k-widget k-header">Name</span>' +
                           '</div>',
          valueTemplate: '<span>#:data.Code#</span>',
          template: '<span class="k-state-default">#:data.Code#</span>' +
                                 '<span class="k-state-default">#:data.Name#</span>',
          dataSource: {
              transport: {
                  read: {
                      url: crudServiceBaseUrl + "/GetStates"
                  }
              }
          },
          filter:"startswith"
      });

Kiril Nikolov
Telerik team
 answered on 11 Jun 2014
1 answer
141 views
Hi,
The following is my (coffee) datasource code excerpt:

schema:
  model:
    id: 'id'
transport:
  destroy:
    url: (model) -> ApiUrl "transmittals/transmittal/#{model.id}"
    type: 'DELETE'
    data: {}

A few things:
.I'd expected the destroy to use type = delete by default, no?
.I'd expected it to add the id to the url itself - do i have to inject it myself (like above)?
.Currently kendo is sending my entire model along with the request, ho can i prevent that?
Alexander Popov
Telerik team
 answered on 11 Jun 2014
1 answer
309 views
i was following the tutorial from
http://demos.telerik.com/aspnet-mvc/listview/editing

and i keep on getting this error,
Unhandled exception at line 9, column 6976 in http://localhost:50879/Scripts/kendo/2014.1.528/kendo.all.min.js

0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'replace': object is null or undefined

most of thread with similar question are asked to check for the duplicate jquery files so i checked mine and seems ok.

 can any one help pls.

my code as below
===============BundleConfig.cs====================

        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                "~/Scripts/jquery-{version}.js",
                "~/Scripts/modernizr-2.6.2.js",
                "~/Scripts/jquery-1.10.2.min.js",
                "~/Scripts/bootstrap.min.js"
                )
                );

            bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
                "~/Scripts/kendo/2014.1.528/kendo.all.min.js",
                //"~/Scripts/kendo/2014.1.528/kendo.timezones.min.js",
                "~/Scripts/kendo/2014.1.528/kendo.aspnetmvc.min.js"));

            bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
            "~/Content/kendo/2014.1.528/kendo.common-bootstrap.min.css",
            "~/Content/kendo/2014.1.528/kendo.bootstrap.min.css"));

            bundles.IgnoreList.Clear();
        }
===============================_Layout.cshtml===================

@using System.Web.Optimization
@*@using Telerik.Web.Mvc.UI*@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @*<link href="~/Content/Site.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />*@
    @*@Html.Telerik().StyleSheetRegistrar().DefaultGroup(group =>group.Add("telerik.common.css").Add("telerik.vista.css"))*@
   
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/kendo")
     @Styles.Render("~/Content/kendo/css")
    
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Application name", "Index", "Home", null, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                </ul>
            </div>
        </div>
    </div>

    <div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>
   
    
    @*@Html.Telerik().ScriptRegistrar() *@
</body>
</html>





Sebastian
Telerik team
 answered on 11 Jun 2014
1 answer
385 views
The long date format on calendar for several cultures does not respect the local format.

Cultures having problem are : zh-tw, ko-kr, ja-jp, pt-pt, pt-br, es-es, es-co, es-cl, fr-ca
 
The expected behavior for different cultures are  as:
       For zh-tw/ko-kr/ja-jp markets, the "MM" are displayed in front of "YYYY" instead of displayed after "YYYY". 
       For pt-pt/pt-br/es-es/es-co/es-cl markets , lacked "de" between "MM" and "YYYY".
       For fr-ca market, lacked "," between "MM" and "YYYY".

Is this the bug with Kendo? How can we fix this?
Georgi Krustev
Telerik team
 answered on 11 Jun 2014
1 answer
383 views
Hi,

I wish to have file upload control within kendo window dialog box. We are using angularjs and on kendo-angular labs page, I can't find file upload control present.

Is it possible to have file upload control on kendo window pop-up dialog? If yes, Can you share a sample?

Thanks!
Atanas Korchev
Telerik team
 answered on 11 Jun 2014
3 answers
759 views
I have a 3 level hierarchical Kendo grid with command columns that invoke long-running JavaScript Ajax functions that invoke Controller methods which in turn act on database tables.  I'm trying to show a wait cursor so the user has a visual cue that the system is busy and is waiting for a response from the server.  Kendo grid CSS seems to be overriding my attempt to show and clear the wait cursor.  How can I make this work properly?

My Javascript method is shown below:

function onClickPostBatch(e) {
    var dataItem = this.dataItem($(e.target).closest("tr"));
    //document.body.style.cursor = "wait";
    $("html").css("cursor", "wait");
      $.post('@Url.Action("PostBatch", "Home")', {
         batchId: dataItem.BatchID
     }, function (data) {
         if (data.error) {
            alert('' + data.message);
        } else {
            alert(data.message);
            location.reload();
        }
     });
    //document.body.style.cursor = "default";
    $("html").css("cursor", "default");
 }


Thanks!

Rich
Kiril Nikolov
Telerik team
 answered on 11 Jun 2014
2 answers
197 views
I am trying use KendoUI javascript library to implement a web dashboard. I have implemented the view functions by getting data from a XML web service and it all works well. But got stuck when I try to introduce edit features.My KendoGrid's datasource schema is as 

schema: {
                type: "xml",
                data: "/xmlResponse/Contacts/Contact",
                model: {
                    id: "NameSequence",
                    fields: {                          
                        name: "Name/text()",
                        phoneNumber: "PhoneNumber/text()",
                        email: "Email/text()",
                        nameSequence: "NameSequence/text()"                        
                    }
                }  
            }



Since i have to map the XML tags to fields in the model fields, how should I specify parameters like editable, nullable or validations. Documentation doesn't provide any help on this. Samples are like below but they only talk about json transports.

schema: {
           model: {
                     id: "ProductID",
                     fields: {
                              ProductID: { editable: false, nullable: true },
                              ProductName: { validation: { required: true } },
                              UnitPrice: { type: "number", validation: { required: true, min: 1} },
                              Discontinued: { type: "boolean" },
                              UnitsInStock: { type: "number", validation: { min: 0, required: true } }
                    }
           }


I want to combine the both worlds and don;t have a clue on how to do that.

Any help would be great...


Vladimir Iliev
Telerik team
 answered on 11 Jun 2014
3 answers
1.3K+ views
Hi:

I would like to add my own methods on the to ListView as follows:
$("#AlertListView").kendoListView({
     dataSource: {
        data: []
    },
    template: "<li>#: message #</li>",
    displayMessages: function( messages ) {
        ...
    },
    hideMessages: function( ) {
        ...
    }
});

Phil

Alexander Valchev
Telerik team
 answered on 11 Jun 2014
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
Drag and Drop
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?