Telerik Forums
Kendo UI for jQuery Forum
2 answers
80 views
Hi everyone,
I am using kendo ui panelbar and grid. they are each in a different div. I would like every time i click on an item in the panel to be able to display content in the grid.
Is this possible? and if so, kindly help me please.

I will be grateful with your responses  
Nheily
Top achievements
Rank 1
 answered on 19 Mar 2013
1 answer
165 views
I would like my draggable element to stay in view, so if I need to drag my item down the page, the page will automatically scroll until I find the place a need to drop it.  Is this possible? 

Thanks,
Joe
Petur Subev
Telerik team
 answered on 19 Mar 2013
3 answers
216 views
How do I reference an existing menu item, when I like to add items to submenu?

var rootMenu = [{text:"one"},{text:"two"}];
$("#menu").kendoMenu({dataSource:rootMenu});

var menu = $("#menu").data("kendoMenu");

menu.append([{text:"one-first"},{text:"one-second"}],// I like to reference to rootmenu [text="one"]);

I tried adding attributes to my root menu, but could not figure out how when I'm populating it from a json.

ref: http://docs.kendoui.com/api/web/menu#methods

Thanks
Dimiter Madjarov
Telerik team
 answered on 19 Mar 2013
2 answers
89 views
Hi,

We have a fairly simple grid on a page.  The grid displays fine in Chrome and IE 10 and IE 9 with compatibility turn on.  With IE9 or IE10 with compatibility turned on, we get the following JS runtime error:

Unhandled exception at line 9, column 7339 in   http://localhost:55974/Scripts/KendoUi/kendo.web.min.js
0x800a139e - Microsoft JScript runtime error: Invalid template:'<tr data-uid="#=data.uid#" role='row'><td  role='gridcell'>${data.[==null?'':data.[}</td><td  role='gridcell'>${data.{==null?'':data.{}</td><td  role='gridcell'>${data. ==null?'':data. }</td><td  role='gridcell'>${data.f==null?'':data.f}</td><td  role='gridcell'>${data.i==null?'':data.i}</td><td  role='gridcell'>${data.e==null?'':data.e}</td><td  role='gridcell'>${data.l==null?'':data.l}</td><td  role='gridcell'>${data.d==null?'':data.d}</td><td 
...

I truncated the full error output but attached the full output to this post.  Again IE9 is the only browser that causes this error.  Everything works fine in IE 10 and IE 8 (and other browsers).

We are evaluating Kendo UI, but this is a major show-stopper for us and we need to make a decision in the next couple of days.  if we cannot find a workaround, we will need to go with a different 3rd party library.  

This is how the grid is declared:
        <table id="jobs" 
               data-role="grid" 
               data-bind="source: jobsList, events: { change: gridChange }"
               data-columns="[{ field: 'Id', width: 50, title: 'Id', filterable: true}, 
                            { field: 'Name', width: 80, title: 'Name', filterable: true}, 
                            { field: 'Description', width: 150, title: 'Description', filterable: true},
                            { command: ['edit','destroy'], title: '' }]"  
               data-toolbar="[{ name: 'create', text: 'Add new job'}]"
               data-pageable="true"
               data-editable="{mode: 'inline', confirmation: 'Are you sure you want to delete this job?  It will not be recoverable'}"
               data-sortable="true"
               data-column-menu="false"
               data-resizable="true"
               data-selectable="true"
               data-filterable="{ extra: false, operators: { string: { startswith: 'Starts with', eq: 'same as',  neq: 'different' }, number: {eq: '==',  neq: '!=' , gt: '>', lt: '<'}}}"
            >
        </table>

I can provide the datasource code as well if needed.

Any help will be greatly appreciated.

Thank you.
Florence
Top achievements
Rank 1
 answered on 19 Mar 2013
7 answers
227 views
Using the Q3 2012 version of Kendo, I'm failing to get an hourly line chart to work if the data spans when daylight savings takes affect. The browser locks up when the time value goes from, say, time zone offset -06:00 to -05:00. Please see the following example:

var data = [
        {
          time: new Date(2013, 2, 9, 22, 0, 0),
          value: 100
        },
        {
          time: new Date(2013, 2, 9, 23, 0, 0),
          value: 200
        },
        {
          time: new Date(2013, 2, 10, 0, 0, 0),
          value: 300
        },
        {
          time: new Date(2013, 2, 10, 1, 0, 0),
          value: 400
        },
        {
          time: new Date(2013, 2, 10, 2, 0, 0),
          value: 500
        },
        {
          time: new Date(2013, 2, 10, 3, 0, 0),
          value: 600
        }
      ];
 
      $("#chart").kendoChart({
        dataSource: {
            data: data
        },
        seriesDefaults: {
            type: 'line'
        },
        series: [{
            field: 'value'
        }],
        categoryAxis: {
            type: 'Date',
            baseUnit: 'hours',
            field: 'time'
        }
      });
    }
It'll render a chart if the last data record at Date(2013, 2, 10, 3, 0, 0) is left out, but fails when it's included. I've tried some other tests where all of the times are before daylight savings takes affect, and other tests where all of the times are after daylight savings takes affect, and they work. But it does not work if the time values cross from standard time into daylight savings.

I guess I'm missing something, but don't see what.
T. Tsonev
Telerik team
 answered on 19 Mar 2013
7 answers
1.1K+ views
I have a datasource schema like this:

schema: {
            data: "permissions.resources.resource",
            model: {
                id: "client_Permission_Id",
                fields: {
                    "resourceno": { editable: true, nullable: true },
                    "uri": { editable: true },
                    "verb": { editable: true }
                }
            }
        }

The service this datasource is connected to returns json like this:
{
  "permissions": {
    "resources": {
      "resource": [
        {
          "client_permission_id": "1",
          "resourceno": "6",
          "uri": "system/api/resources?verbs={verbs}&pathsearch={pathsearch}",
          "verb": "get"
        },
        {
          "client_permission_id": "2",
          "resourceno": "7",
          "uri": "system/api/resources/{resourceno}",
          "verb": "get"
        }
      ]
    }
  }
}

It works fine, but the result from the service can be empty, and the json result will then look like this:
{
  "permissions": {
    "resources": null
  }
}

In this case the datasource will fail.It gives the following errormsg:
Uncaught TypeError: Cannot read property 'resource' of null
(anonymous function)
Class.extend.init.that.datakendo.web.js:5225
Observable.extend.successkendo.web.js:5630
e.extend.proxy.gjquery.min.js:2
Class.extend.read.options.successkendo.web.js:5118
f.Callbacks.njquery.min.js:2
f.Callbacks.o.fireWithjquery.min.js:2
wjquery.min.js:4
f.support.ajax.f.ajaxTransport.send.d

I understand that it fails because permissions.resources is null, but when this happens the datasource seems to enter a state it cannot recover from. If I now call the read() method on the datasource it will not result in a network call. Nothing happens at all.

How can I solve this?
Rosen
Telerik team
 answered on 19 Mar 2013
1 answer
258 views
Hi,

I've got an issue when rebinding the datagrid and aggregates.

The following javascript creates the grid. Columns of the reports are unkown, the data I'm getting contains an array with the column list, and an array with the actual data.

I found this problem when executing a report that has left joins, so if there is no data, I still get rows, but no values to the columns I want to aggregate.

If the first time the report is generated has no data, the aggregates are not created the second time round, even if I do have data.

But if the first time the data loads I have data the aggregates are shown. Then if the second time I don't have data, I receive the following error "Uncaught TypeError: undefined has no properties" at "grid.setDataSource(newDs);"

var reports = {
    getGridColumns: function (columns) {
        var columnArray = [];
 
        $.each(columns, function (i, c) {
            var column = { field: c.Name, title: c.Title, width: 150 };
            if (c.Format) {
                column.format = '{0:' + c.Format + '}';
            }
            if (c.ShowTotals) {
                column.footerTemplate = "#=kendo.toString(sum,'" + c.Format + "')#";
            }
            columnArray.push(column);
        });
        return columnArray;
    },
    getGridAggregates: function (columns) {
        var columnArray = [];
 
        $.each(columns, function (i, c) {
 
            if (c.ShowTotals) {
                columnArray.push({ field: c.Name, aggregate: "sum" });
            }
 
        });
        if (columnArray.length == 0) { columnArray = undefined; }
        return columnArray;
    },
    bindKendoGrid: function () {
        $.ajax({
            type: 'POST',
            url: '/Reports/GetReportData',
            data: reports.getReportParams(),
            success: function (data) {
                if (data && data.Data && data.Data.length > 0) {
                    if (!$('#report-grid').data('kendoGrid')) {
                        $('#report-grid').kendoGrid({
                            dataSource: {
                                data: eval(data.Data),
                                pageSize: 15,
                                aggregate: reports.getGridAggregates(data.Columns)
                            },
                            columns: reports.getGridColumns(data.Columns),
                            scrollable: true,
                            sortable: true,
                            filterable: true,
                            pageable: {
                                input: true,
                                numeric: false
                            }
                        });
                    }
                    else {
                        var grid = $('#report-grid').data('kendoGrid');
 
                        var newDs = new kendo.data.DataSource({
                            data: eval(data.Data),
                            pageSize: 15,
                            aggregate: reports.getGridAggregates(data.Columns)
                        });
                        grid.setDataSource(newDs);
                    }
                    $('#report-grid').css('display', 'block');
 
                    $('#report-container #report-export').show();
                }
                else {
                    $('#no-data').css('display', 'block');
                }
                $('#report-container').css({ position: '', width: '', height: '' });
                kendo.ui.progress($("#report-container"), false)
                $('#btnReportRefresh').removeAttr('disabled').removeClass('k-state-disabled');
            },
            error: function (data) {
                kendo.ui.progress($("#report-container"), false)
                $('#btnReportRefresh').removeAttr('disabled').removeClass('k-state-disabled');
                $('#no-data').css('display', 'block');
                kendo.ui.progress($("#commissions-dashboard"), false);
            }
        });
    }
}

Alexander Valchev
Telerik team
 answered on 19 Mar 2013
1 answer
71 views
When a mobile ListView widget is placed into a different widget and data bound to the ListView by MVVM mechanism, while updating the data, memory leaks occurring. If a small piece of data is updated every second, one megabyte of memory leaking every two seconds. I discivered how to fix it. To do this, change the code of the refresh() method as follows:
      if (e.action === "itemchange") {
        data = e.items[0];
        item = $(that.template(data));

        element.find("[data-" + kendo.ns + "uid=" + data.uid + "]").replaceWith(item);

        /* Add this lines */
        if (data.toJSON) {
          data = kendo.observable(data.toJSON());
        }
        /* the end */

        that.trigger("itemChange", {
          item: item,
          data: data,
          ns: ui
        });

        that._style();
        return;
      }
It is important that the property "uid" of the object "data" being different from the same property of the object e.items[0] contained in the event.
Georgi Krustev
Telerik team
 answered on 19 Mar 2013
1 answer
182 views
GridEditMode.InLine doesn't work but if I changed InLine to InCell, It will work. Could you please help me to make inLine work?

Dimiter Madjarov
Telerik team
 answered on 19 Mar 2013
7 answers
169 views
Greetings,

I'm seeing tabstrip icons when running my page from within Visual Studio 2012 using IE 10, which is the correct behavior.  However, when running the exact same page (same folder structure and all supporting files) from an IIS web site, the icons disappear.

What's strange is the icons are only missing when running using IE 10.  When running from Chrome, Safari, mobile Android, etc.. the icons are present (see images).

How can I get the icons to render properly when running from an IIS web site using IE 10?

Thanks.  BTW, this is the only issue I've encountered thus far.  The beta code is working great otherwise.  Nice work.
Kamen Bundev
Telerik team
 answered on 19 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?