Telerik Forums
Kendo UI for jQuery Forum
3 answers
146 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
300 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
496 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
116 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
82 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
124 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
244 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
1 answer
87 views
I have a grid using this command...

.Destroy(update => update.Action("EditingInline_Destroy", "Grid"))

and it hits my controller as expected...

  public ActionResult EditingInline_Destroy([DataSourceRequest] DataSourceRequest request, MemoModel memo)

But the memo is coming in Null.

How is the Destroy or Update supposed to pass in the object or ID of the row being deleted?
     

Vladimir Iliev
Telerik team
 answered on 05 Dec 2013
1 answer
82 views
Is there a way to manually change the width of a column client side? I am setting the width property to something and its registering but it does not display the new width until I do a hide/show column or another grid action. Is there a way to manually trigger this column size refresh?
Dimiter Madjarov
Telerik team
 answered on 05 Dec 2013
4 answers
105 views
Hi
I'm trying to use web SQL databases with kendo mobile datasources. My code is based on a Kendo Web example that works fine but there is no way to make it works on mobile version. It doesn't trhow any exception but it doesn't works. Anyone has do it? I attached my code.
Thanks
Alexander Valchev
Telerik team
 answered on 05 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?