Telerik Forums
Kendo UI for jQuery Forum
1 answer
125 views
Hello we have one grid with group by column as in below code.
 
 @(Html.Kendo().Grid<Xyz>()
     .Name("OwnerGrid")
     .Columns(columns =>
     {
                columns.Bound(p => p.OwnerName).Hidden().ClientGroupHeaderTemplate("#= value #").HeaderHtmlAttributes(new { style = "text-align:left;" }).HtmlAttributes(new { style = "text-align:left;" });      
        columns.Bound(p => p.ShortDescription).Width("20%").HeaderHtmlAttributes(new { style = "text-align:left;" }).HtmlAttributes(new { style = "text-align:left;" });
         columns.Bound(p => p.Description).Width("30%").HeaderHtmlAttributes(new { style = "text-align:left;" }).HtmlAttributes(new { style = "text-align:left;" });
         columns.Bound(p => p.Status).Width("15%").HeaderHtmlAttributes(new { style = "text-align:left;" }).HtmlAttributes(new { style = "text-align:left;" });
         columns.Bound(p => p.Date).Width("10%").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(new { style = "text-align:right;" }).HtmlAttributes(new { style = "text-align:right;" });
     })
  .DataSource(dataSource => dataSource
         .Ajax()
  .ServerOperation(false)
         .Read(read => read.Action("GetData", "Home"))
        
        .Group(groups =>
         {
             groups.Add(p => p.OwnerName);
         })
 
So here we have Group by with "OwnerName".  Our requirement is when we sort by "ShortDescription" it should first sort by "OwnerName" and then by "ShortDescription".  I know its possble by custom binding at server side - i took help from below article http://demos.telerik.com/aspnet-mvc/razor/grid/custombinding
 
But is it possible at client side? can we avoid server side trip? as .ServerOperation(false) works for normal grid.
Dimiter Madjarov
Telerik team
 answered on 13 May 2013
1 answer
184 views
I am creating a web application where there are several kendo dropdownlists which update their items in concert with each other: ei. each dropdownlist has a change handler which updates the content of the others (kind of like an advanced cascade, but where all the dropdowns have initial values, and selecting one filters the items of all the others).

This is the code for rendering a dropdownlist server side (using the MVC wrappers):

@(Html.Kendo().DropDownListFor(model => model.MakeId)
    .OptionLabel("Any")
    .DataTextField("Value")
    .DataValueField("Key")
    .DataSource(source => source.Read(read => read.Action("GetMakes", "Criteria").Data("getCriteria")))
    .Events(e => e.Change("criteriaChange"))
)

In the criteriaChange javascript method, I simply "read" the datasources of all the dropdownlists:

        function criteriaChange() {
            $('#MakeId').data('kendoDropDownList').dataSource.read();
            $('#ModelId').data('kendoDropDownList').dataSource.read();
            $('#ServiceId').data('kendoDropDownList').dataSource.read();
            ...
        }

On initial page load everyting is ok, the dropdownlists all show "Any", and when I open the lists, the "Any" option is actually selected (surrounded with an orange border).
When I change one of the dropdownlists, the data of all the others is reloaded, and the "Any" option is still shown, but when I open one of the dropdowns, the "Any" option isn't surrounded with the orange border anymore.

This seems like a bug maybe? Or I am missing something? I tried to add a "refresh()" call after the "read()" call, but that doesn't change anything.

This is just a minor estethic problem, but it would be nice if I could find a solution for it.
Georgi Krustev
Telerik team
 answered on 13 May 2013
3 answers
152 views
Hello!
I'd like like to be able to specify during runtime  what columns grid would have.  Is this functionality available in 2013 Q1?

More scenario details:
  user checks in multiselect countries he is interested in (USA, Germany, Australia) and grid is created with 3 columns for corresponding country :
                          USA     Germany   Australia
          Metric1     2              32             12
          Metric2    15             10             11
 Then user also selects Japan and it's added as column #4 to the grid


Alexander Valchev
Telerik team
 answered on 13 May 2013
2 answers
115 views
Hello Support:

I'm trying to reference DataSource through RequireJS under Durandal, and I'm having issues.  As you may know (since Kendo UI is promoted as being compatible with Durandal on the Durandal website), Durandal uses AMD and accesses modules relative to a baseURL specified on a data-main attribute.

I know now that Kendo UI supports RequireJS, so that simply referencing "kendo.grid.min", for example, in a list of RequireJS dependencies injects the kendo.grid.

Two questions:
  1. How do I reference DataSource?  I assumed the pattern would be kendo.datasource.min, but it isn't;
  2. Is there a way to get to DataSource on the CDN?  I would prefer to shim to the CDN than adjust the baseURL to point to the root.
With respect to #2 above, the default baseURL for Durandal is ~/App/.  I don't want to go to ~/.

Ultimately, my goal is simply to inject a DataSource using RequireJS under Durandal.

Thank you.

Eric
Eric
Top achievements
Rank 1
 answered on 13 May 2013
1 answer
190 views
I basically want to know if I can extend the Editor to include a Print functionality via a button in the toolbar.

Edit: I will be using HTML helper of the Kendo Editor

Thx,
Aaron
Dimo
Telerik team
 answered on 13 May 2013
1 answer
204 views

Anyone else have this happen?

Adding kendo.all.* in my BundleConfig.cs throws a javascript error every time (only for IE browser):

Microsoft JScript runtime error: Unable to get value of the property 'msie': object is null or undefined

I'm using IE9.  The debugger highlights this code inside the kendo.all.min.js file:

D=e.browser.msie&&8>parseFloat(e.browser.version)?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()}

I'm using jQuery 1.9.1 and my bundleconfig class has the below code (I've put all css first, but the js files order is correct per Kendo documentation)

01.public class BundleConfig
02.{
03.    public static void RegisterBundles(BundleCollection bundles)
04.    {
05.        bundles.Add(new StyleBundle("~/Content/css").Include(
06.                    "~/Content/site.css"));
07. 
08.        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
09.                    "~/Content/themes/base/jquery.ui.all.css"));
10. 
11.        // Kendo CSS bundle
12.        bundles.Add(new StyleBundle("~/Content/kendo").Include(
13.                    "~/Content/kendo.common.*",
14.                    "~/Content/kendo.default.*"));
15. 
16. 
17.        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
18.                    "~/Scripts/jquery-{version}.js"));
19. 
20.        bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
21.                    "~/Scripts/jquery-ui-{version}.js"));
22. 
23.        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
24.                    "~/Scripts/jquery.unobtrusive*",
25.                    "~/Scripts/jquery.validate*"));
26. 
27.        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
28.                    "~/Scripts/modernizr-*"));
29. 
30.        // Kendo Script bundle
31.        bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
32.                    "~/Scripts/kendo.all.*",
33.                    "~/Scripts/kendo.aspnetmvc.*"));
34. 
35.        // Clear all items from the ignore list to allow minified CSS and JavaScript files in debug mode
36.        bundles.IgnoreList.Clear();
37. 
38. 
39.        // Add back the default ignore list rules sans the ones which affect minified files and debug mode
40.        bundles.IgnoreList.Ignore("*.intellisense.js");
41.        bundles.IgnoreList.Ignore("*-vsdoc.js");
42.        bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
43. 
44.    }
45.}
Vladimir Iliev
Telerik team
 answered on 13 May 2013
1 answer
73 views
This is in reference to the documentation at http://docs.kendoui.com/getting-started/framework/spa/router.

It indicates that "/items" is valid for the route "/items/*suffix" but it does not match because there is no trailing slash. If I use a route of "/items*suffix" instead it works.

Perhaps you can correct the documentation, so that it isn't misleading.

Thanks,
Gary
Petyo
Telerik team
 answered on 13 May 2013
1 answer
58 views
My app sets up several routes and then starts the router. I have a scenario now in which I'm loading additional code on demand, which requires its own routes. I need the new routes to be inserted at the beginning of the route collection because they handle more specific cases than what was added initially.

I got it working using the following code:
_router.route(route, callback);
_router.routes.unshift(_router.routes.pop());
Is this the recommended approach?

Thanks,
Gary
Petyo
Telerik team
 answered on 13 May 2013
5 answers
102 views
I'm not sure where to post bug information. Please let me know if it should go somewhere other than here.

In 2013 Q1's builds (and at least the current latest internal build as well as the previous) kendo core references the wrong jQuery instance. Using the latest internal build as reference (build 506):

  • Line 2790 uses jQuery.each instead of $.each
  • Line 2794 uses jQuery.event.special instead of $.event.special
  • Line 2806 uses !jQuery.contains instead of !$.contains
I'm sure these go unnoticed to most users but I wrap my kendo scripts to be loaded with RequireJS and it's important that the correct reference provided by the closure is used.
Petyo
Telerik team
 answered on 13 May 2013
1 answer
110 views
My code below does not populate the fields in the grid. I get an empty grid with headers only.
Fiddler shows that the read is executed and returning results. Any ideas?
$("#pageresultGrid").kendoGrid({
            dataSource: {
                type: "odata",
                schema: {
                    model: {
                        fields: {
                            DRG: { type: "string" },
                            DRGDescription: { type: "string" },
                        }
                    },

                    errors: function (response) {
                        return response.errors;
                    },
                    data: function (response) {
                        return response["value"];
                    }
                },
                transport: {
                    read: {
                        url: ksWebApiSearchUrl,
                        dataType: "jsonp"
                    }
                }
            },

            pageable: {
                numeric: true,

                refresh: true,

                pageSize: 5,

                previousNext: true,

                input: false,

                info: false,
                messages: {
                    display: "Viewing {0} - {1} of {2}",
                    empty: "No items to display",
                    page: "Page",
                    of: "of {0}",
                    itemsPerPage: "items per page",
                    first: "Go to the first page",
                    previous: "Go to the previous page",
                    next: "Go to the next page",
                    last: "Go to the last page",
                    refresh: "Refresh"
                }
            },
            sortable: true,
            columns: [
            {
                headerTemplate: '<input type="checkbox" id="checkAll">',
                template: '<input type="checkbox" value="1" id="results-select-row1"><label class="visuallyhidden" for="results-select-row1">Select Row</label>',
                width: 40
            },
            {
                field: "DRG",
                headerAttributes: {
                    "class": "ks-gridheader"
                },
                template: '<a href="javascript:GetTabDetail(#=DRG#)">#=DRG#</a>',
                width: 60,
                title: "DRG"
            },
            {
                field: "DRGDescription",
                headerAttributes: {
                    "class": "ks-gridheader"
                },
                width: 130,
                title: "DRG Description"
            }
            ]
        });
Nikolay Rusev
Telerik team
 answered on 13 May 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?