Telerik Forums
Kendo UI for jQuery Forum
2 answers
91 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
236 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
264 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
78 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
186 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
173 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
1 answer
101 views
Below is the definition for my datasource object.  In the change event, I am setting focus based on whether or not the datasource contains any items.  Focusing on the dropdownlist ("custom1combo") is working, however the part where focus is set on "portraitNotes", which is a text area, is not working.

This is the line in question:
$("#portraitNotes").focus();

The weird thing is it works fine in other areas of my site, just not here.


custom1DataSource = new kendo.data.DataSource({
    serverFiltering: true,
    transport: {
        read: {
            url: "wsRest.svc/custom1/",
            data: {
                user: function () {
                    return userField.value;
                },
                client: function () {
                    return $("#clientCombo").val();
                },
                matter: function () {
                    return $("#matterCombo").val();
                }
            }
        }
    },
    change: function () {
        //when data is updated, if there is more than 1 item we need to enable the menu
        var custom1 = $("#custom1Combo").data("kendoDropDownList");
        custom1.enable(false);
         
        if (custom1DataSource.data().length > 1) {
            custom1.enable(true);
    $("#custom1Combo").focus();         
        }
    else {
                            $("#portraitNotes").focus();
        }
    }
});




Petur Subev
Telerik team
 answered on 19 Mar 2013
1 answer
68 views
How do I scroll to top, in a pane in a split view, from javascript?

I have tried several hours with different things but cant get it to work.

Thanks
Alexander Valchev
Telerik team
 answered on 19 Mar 2013
2 answers
301 views
Hi

I've got the URL below which always returns a single record.  How do I return the Content field and update the html of a div on the page?

http://dsdmservices.azurewebsites.net/dsdmRest.svc/GetContent?BookMenuID=4

Returns:
{"BookMenuID":4,"Content":"<span>DSDM advocates........"}

I've tried the code below so far (amongst many others) but the alert shows "undefined" as the result...
var dataSource = new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: "http://dsdmservices.azurewebsites.net/dsdmRest.svc/GetContent?BookMenuID=4", // the remove service url
                                dataType: "jsonp" // JSONP (JSON with padding) is required for cross-domain AJAX
                                  }
                            }               
                        });
               
            dataSource.read();
             
            alert(dataSource.length);
             
            var dataItem = dataSource[0];
            $('#divContent').html(dataItem.Content);


Cheers
Cliff
Cliff Gibson
Top achievements
Rank 1
 answered on 19 Mar 2013
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
Map
Drag and Drop
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?