Telerik Forums
Kendo UI for jQuery Forum
1 answer
124 views

Is there any way to change the year just like month on single click(i.e clicking on side arrows),
now in order to change the year we must make 3 clicks.

The problem is I kept the calendar in Drop down list, so if i want to change the year,
I must open the drop down 3 times this is horrible to user.
Kiril Nikolov
Telerik team
 answered on 06 Dec 2013
16 answers
364 views
When I run a listview with native scrolling enabled, and there is enough items to make it scroll, the containing ul element is twice as long as it normally should be on the SGS3 I am testing on running 4.1.2. Other devices I deploy to seems to not have this issue some running 4.2.

I feel like it is related to the '-webkit-transform-origin' being set to something weird. The list looks fine, but when you click on an item it is almost like the clickable vertical area  is expanded by 2x. Its weird because it is visually rendered fine, but there is lots of extra white space below the list and the clickable areas of each list item doesn't correspond with the visual area, its much larger vertically than it would normally be and ends up shifting each clickable area downward.

Running Kendo UI Complete v2013.2.716

Kiril Nikolov
Telerik team
 answered on 06 Dec 2013
2 answers
245 views
Hello,

I'm using Kendo UI to create a SPA business application, which works perfect, except for 1 thing concerning the kendo Grid.
Since the last version, i noticed the pager popup is being appended to the body instead of the container element in which a view is shown.
Normally this wouldn't be so much of a problem, except that detaching a view with a grid doesn't detach the pager popup.
So when switching back and forth between different views, pager popups keep getting appended to the body.

I attached 2 files.
1 shows 4 divs with the pager popup, the result after switching views 4 times.
the other one shows the grid itself.

The page options are being set through creating the grid.
$('#business-grid').kendoGrid({
            dataSource: that._businessDatasource,
            autoBind: false,
            sortable: true,
            selectable: "row",
            navigatable: true,
            pageable: {
                refresh: true,
                pageSizes: [5, 10, 15, 20],
                messages: {
                    display: "{0} - {1} van {2} bedrijven",
                    itemsPerPage: "bedrijven per pagina"
                }
            }
}
I hope this is a bug and can be fixed.

Thanks in advance.
Marcel
Top achievements
Rank 1
 answered on 06 Dec 2013
3 answers
150 views
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCExcelReportDashboardView.aspx.cs" Inherits="Shell.SharePoint.SSP.SSC.Visualization.SCExcelReportDashboardView" %>
 
<html>
    <head id="head1" runat="server">
        <title>Excel Report</title>     
<style type="text/css">
    ul
    {
    list-style-type:none;
    margin:0;
    padding:0;
    }
    li
    {
    display:inline !important;
    }  
</style>
    </head>
    <body>
<div id="loadingDivExcelReport" style="display: none; z-index: 1000; position: absolute; padding-top: 130px; padding-left: 50%;text-align:center">
<img id="" alt="loading.." src="/_layouts/images/Shell.SharePoint.SP.SSC/KendoUI/loading-image.gif"><br>Loading content, please wait..
</div>
 <table>
    <tr>
    <td >
        <div id="excelReportTabstrip"
               
        </div>      
    </td>
    </tr>
</table>
 
 <script type="text/javascript">
     var exportToExcelUrl;  
     function onSelect(e) {
         //alert("onSelect");
         $('#loadingDivExcelReport').css('display', 'block');
         if (e.item.innerText == "Export") {
             window.location.href = exportToExcelUrl + "/model?$format=workbook";
         }     
         //kendoConsole.log("Selected: " + $(e.item).find("> .k-link").text());
     }
 
     function onActivate(e) {
         //alert("onActivate");
         $('#loadingDivExcelReport').css('display', 'none');
         //kendoConsole.log("Activated: " + $(e.item).find("> .k-link").text());
     }
 
     function onContentLoad(e) {
         //alert("onContentLoad");
         //kendoConsole.log("Content loaded in <b>" + $(e.item).find("> .k-link").text() + "</b> and starts with <b>" + $(e.contentElement).text().substr(0, 20) + "...</b>");
     }
 
     function onError(e) {
         alert("Loading failed with " + e.xhr.statusText + " " + e.xhr.status);
         //alert("Error Occured While Loading...!");
         //kendoConsole.error("Loading failed with " + e.xhr.statusText + " " + e.xhr.status);
     }
     $(function () {
         //debugger;
         function GetQueryParameters() {
             var vars = [], hash;
             var hrefValue = window.location.href;
             hashes = hrefValue.slice(hrefValue.indexOf('?') + 1).split('&');
             for (var i = 0; i < hashes.length; i++) {
                 hash = hashes[i].split('=');
                 vars.push(hash[0]);
                 vars[hash[0]] = hash[1];
             }
             return vars;
         }
         var tabStrip = $("#excelReportTabstrip").kendoTabStrip({ animation: false, collapsible: false, select: onSelect, activate: onActivate, contentLoad: onContentLoad, error: onError }).data('kendoTabStrip');
         var fileName = GetQueryParameters()["ExcelFileName"];
         var excelSheetInfo = GetQueryParameters()["SheetNames"].split('|');
         var startDateTime = GetQueryParameters()["StartDate"];
         var endDateTime = GetQueryParameters()["EndDate"];
         var analysisMode = GetQueryParameters()["AnalisysMode"];
         var currentWebUrl = window.location.pathname;
         currentWebUrl = currentWebUrl.substring(0, currentWebUrl.lastIndexOf('/') - 7);
         exportToExcelUrl = window.location.protocol+"//" + window.location.host + currentWebUrl + "_vti_bin/ExcelRest.aspx/Lists/SCExcelReports/" + fileName;
         for (var i = 0; i < excelSheetInfo.length; i++) {
             var excelReportUrl =window.location.protocol+"//" + window.location.host + currentWebUrl + "_vti_bin/ExcelRest.aspx/Lists/SCExcelReports/" + fileName + "/model/Ranges('" + excelSheetInfo[i] + "')?Ranges('AnalysisPeriod')=" +
                                            "%22" + startDateTime + ";" + endDateTime + ";" + analysisMode + "%22";
             tabStrip.append({
                 text: excelSheetInfo[i],
                 contentUrl: excelReportUrl
             });
         }
         tabStrip.append({
             text: 'Export',
             imageUrl: "/_layouts/images/Shell.SharePoint.SP.SSC/KendoUI/ExportToExcel.png",
             content: "Export to Microsoft Excel"
         });
         tabStrip.select(tabStrip.tabGroup.children('li').eq(0));
     });
 </script>
    </body>
</html>
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI;
using Microsoft.SharePoint.Utilities;
using Shell.SharePoint.SSP.SSC.Common;
using System.Web.UI.HtmlControls;
 
namespace Shell.SharePoint.SSP.SSC.Visualization
{
    public partial class SCExcelReportDashboardView :Page
    {
        protected void Page_Init(object sender, EventArgs e)
        {  
            string[] jsArray = new string[] { "/SCJquery/jquery.min.js", "/SCJquery/kendo.all.min.js"};
 
            string[] cssArray = new string[] { "/SCCss/kendo.common.min.css", "/SCCss/kendo.default.min.css"};
 
            for (int jsIndex = 0; jsIndex < jsArray.Length; jsIndex++)
            {
                HtmlGenericControl jScript = new HtmlGenericControl("script");
                jScript.Attributes.Add("type", "text/javascript");
                jScript.Attributes.Add("src", SPContext.Current.Site.Url + jsArray[jsIndex]);
                Page.Header.Controls.Add(jScript);
            }
            for (int cssIndex = 0; cssIndex < cssArray.Length; cssIndex++)
            {
                HtmlLink cssLink = new HtmlLink();
                cssLink.Href = SPContext.Current.Site.Url + cssArray[cssIndex];
                cssLink.Attributes.Add("rel", "stylesheet");
                cssLink.Attributes.Add("type", "text/css");
                Page.Header.Controls.Add(cssLink);
            }
             
        }
        
        protected void Page_Load(object sender, EventArgs e)
        {
                 
             
        }
    }
}
Dimo
Telerik team
 answered on 06 Dec 2013
4 answers
305 views
Hi, I'm trying to put some results in a ListView with Endless Scroll.

I have
<div class="view-content">
    <ul id="searchResults"></ul>
</div>

<script type="text/x-kendo-tmpl" id="template">
            <a data-role="button" data-bind="click: onDetails(#= var1 #)">
                <div class="person">
                    <h3>#:var2#</h3>
                    <p>#:var3#</p>
                    <p>#:var4#</p>
                </div>
            </a>
        </script>
in my index.html file.

Then, I have
var dataSource = new kendo.data.DataSource({
    data: response
});

$("#searchResults").kendoMobileListView({
    dataSource: dataSource,
    template: $("#template").text(),
    endlessScroll: true,
    virtualViewSize: 50
});
in a separate script file.

The variable response is the response from the success callback of an ajax call. The initialization of the Mobile ListView is inside of the success callback. I have my reasons for doing this instead of using the transport: read option in the Kendo UI's DataSource.
In the Q2 version of Kendo UI, it would bunch all the results at the top; that is, all the results would be shoved into the space for one result.
In the Q3 version of Kendo UI, I get an uncaught TypeError: "Cannot call method 'makeVirtual' of null at kendo/js/kendo.mobile.min.js (line: 15)."

I have tried setting the pageSize of the dataSource, but the Q3 release brought the promise of virtualizing local data. Unfortunately, it isn't working.
Thanks in advance!
Mohammed
Top achievements
Rank 1
 answered on 05 Dec 2013
10 answers
514 views
I'm trying to get the scheduler to print out the month view exactly as it appears on the screen, but I'm having trouble. I tried the advice at the bottom of this page: http://docs.kendoui.com/getting-started/web/scheduler/overview, but it didn't fix the issue.

The event "blocks" aren't placed in the correct location(s). I've attached screenshots of the scheduler and of the print preview. It seems this is the case for the scheduler in the demo too - does this mean the scheduler is not printable in month view?

Thanks,

Rachael
Dimo
Telerik team
 answered on 05 Dec 2013
5 answers
121 views
Hello :)

I did post the same kind of question in the kendo ui framework general Discussions and i got an answer but i fact my question is more about kendo ui mobile ...

I was wondering if it was possible to use the data-click property to call a method that is inside a class that i instanciate and also using the data-attributes to pass data to this method.

i did try some things but it doesn't work. someone gave an example of this in the kendo ui framework general section but it uses the data-bind property and i do want to use the data-click one : 

<!DOCTYPE html>
  
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="./styles/kendo.common.css" rel="stylesheet" />
    <link href="./styles/kendo.default.css" rel="stylesheet" />
    <script src="./lib/jquery.min.js"></script>
    <script src="./lib/kendo.all.min.js"></script>
      
    <script>
        var Test = kendo.Class.extend({
            myAlert: function (e) {
                alert("test");
            }
        })
  
        $(document).ready(function () {
            var test = new Test();
  
            kendo.bind($("#test"), test);
        })
    </script>
  
</head>
<body>
    <div data-role="view" id="test">
        <a href="#test" class="button" data-role="button" data-bind="events: { click: myAlert }" data-icon="search">buttonTest</a>
    </div>
</body>
</html>
i simply tried to remove the bind cause it wasn't what i wanted and replace the data-bind by a data-click but it of course doesn't work.

so would it be possible to provide an example that uses the things i said before please ? 

thank you so much for helping.

Morgan
Top achievements
Rank 1
 answered on 05 Dec 2013
1 answer
85 views
We have a web application which needs to function when internet connectivity fails. Currently we do this by cache data in localdb, then if the connection goes down, we resort to supplying data from the localdb, instead of the ajax call. When connectivity comes back we update our cache. This works well with our existing product, which uses asp.forms, and jquery templates.

In our new product we building, it is using MVC and kendo. We are using pure JS for our views rather than Razor (due to the limitations of Razor).  We have used AJAX for all the DataSource's, by simply providing a URL to read from. I know I can set the read parameter to be a function. In this function I can do a check to see if there is network connectivity. If no, then read from local db. If there is connectivity then perform the normal read from the controller action.

The original plan was to use jlinq (of hugoware.com), with Persist-JS (https://github.com/jeremydurham/persist-js). But now wondering if breeze js or jaydata would work better with kendo?
Alexander Popov
Telerik team
 answered on 05 Dec 2013
1 answer
129 views
I'm trying to make a 100% height scrollview. If I make it using html attributtes (<data-role="scrollview" data-source="_500pxBatchDS"  data-template="scrollview-batch-template" data-items-per-page="4" data-content-height="100%" data-enable-pager="false">) it works right.

But I bind it using javascript functions seems that do nothing. You can see it in this example if you change the height style in batch-page to 100% at this sample:
http://jsbin.com/ULiwADU/2/edit

How can I make it works?

Thanks
Alexander Valchev
Telerik team
 answered on 05 Dec 2013
1 answer
249 views
I have this view, as below, which is bound the viewModel/module shown below (loaded up via requirejs as per the KendoUI Mobile Music Store).  When I load the page, the authenticate is being called (i.e., it's making that ajax network call as well).
<div data-role="view" id="login-view" data-layout="blank"
     data-model="app.views.login.viewModel">
 
    <h1 style="text-align: center;">Title</h1>
    <form id="login">
        <input data-bind="value: username" id="username" type="text" placeholder="Username" /><br />
        <input data-bind="value: password" id="password" type="password" placeholder="Password" /><br />
        <input type="submit" value="Login" data-bind="click: authenticate" />
    </form>
</div>
define(["jQuery", "kendo", "modernizr", "app/environment"], function ($, kendo, modernizr, environment) {
    var authenticate = function (username, password) {
        return $.ajax({
            url: environment.apiConnection + '/canlogin?userid=' + username + '&password=' + password,
            type: 'get',
            dataType: 'jsonp'
        });
    }
 
    authenticate().done(function (data) {
        alert(data);
    }).fail(function() {
        alert('fail');
    })
 
    return {
        viewModel: kendo.observable({
            username: null,
            password: null,
            authenticate: function () {
                var username = this.get('username'),
                    password = this.get('password');
 
                authenticate(username, password);
 
                if (!Modernizr.localstorage) {
                    alert('There was an error accessing LocalStorage on this device.');
                    return;
                }
 
                localStorage["username"] = username;
                localStorage["password"] = password;
            }
        })
    }
});
Thomas
Top achievements
Rank 1
 answered on 05 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?