Telerik Forums
Kendo UI for jQuery Forum
3 answers
368 views

Hi 

been trying to find a solution to a problem i have trying to solve over the last few days and beginning to wonder if its even possible.

I have set up a "Dojo" with all the code snippets which can be found here - http://dojo.telerik.com/aBuVul/7

The issue stems from the need to be able to reference data with a name that may contain hyphen in a template.

an example can be seen below, more details examples can be seen on the Dojo link above

var DashFirstName = "first-name",
        dashData = new kendo.data.DataSource({
        data: [
          {"first-name": "Joe", "country": "Germany"}, 
          {"first-name": "Jane", "country": "UK"},
          {"first-name": "Maria", "country": "Spain"}
        ]
      });
      $("#grid2").kendoGrid({
        dataSource:dashData,
        columns: [{
          field: "[\"first-name\"]",
          test: "22",
          title: "First Name",
          template: "<input type='radio' name='#= data." + DashFirstName + "#'>#= data." + DashFirstName + "#",
          width: 200
        }, {
          field: "country",
          title: "Country"
        }]
      });

I've tried various escapes to no avail... Any ideas would be greatly appreciated.

 

Andrew
Top achievements
Rank 1
 answered on 23 Nov 2016
18 answers
619 views

Our application makes repeated calls to the spreadsheet control, sometimes numbering in the tens of thousands. The application logic sets cell values, then reads back the value of other, calculated cells.

Execution speed gets slower and slower over time. For example with a simple spreadsheet, I can run 500 iterations in roughly 10 seconds. The second block of 500 iterations takes 27 seconds and the 3rd block of 500 iterations takes 44 seconds. As a rough approximation, there is an exponential fall-off in performance, presumably due to memory-allocations internally.

The problem manifests itself in the cell SetValue() method. Initially, this method returns control to the calling program in less than 1ms. But after say, 1500 iterations, this method is taking 200 to 300ms.

In case it helps with reproducing the problem: this delay only occurs if SetValue() follows a call to the cell GetValue() method. If GetValue() does not get called, then repeated calls to the SetValue() method happen quickly, in <1ms

Am hoping there is an easy fix for this. 

Regards,

Mike Wiese

Dunsborough

Western Australia

Aylin
Telerik team
 answered on 23 Nov 2016
9 answers
390 views
Hi - I have a grid that I am doing batch updates on, and I'm getting an error as shown in the attached screen shot.  I'm not sure what I'm doing wrong?  The text of the error is "Uncaught TypeError: Cannot call method "call" of undefined.
Thanks for any help.

Lisa

Here is my code:
/**
 * This is a security dashboards controller
 */
define([
    'wsipccontext',
    'jquery',
    'underscore',
    'utils/helpers',
    'utils/alerts',
    'kendoui/kendo.core.min',
    'kendoui/kendo.data.min',
    'kendoui/kendo.splitter.min',
    'kendoui/kendo.panelbar.min',
    'kendoui/kendo.grid.min'
 
], function (WSIPCContext, $, _, Helpers, Alerts, studentDetailTemplate) {
    //PRIVATE PROPERTIES
    var ksCharts, ksMain,
        kgSecurityGrid, ksChartsAndGrid, kpbContent,
        firstPass, nextRead, dsSchoolRiskFactors;
 
    //CONSTRUCTOR
    var init = function () {
        //ON DOC READY
        $(function () {
            initElements();
            onInitialLoad();
        });
    };
 
    var init1 = function () {
        //ON DOC READY
        $(function () {
            onInitialLoad();
        });
    };
 
    //EVENTS
    var initElements = function () {
        firstPass = true;
        nextRead = false;
 
 
        ksMain = $("#main").kendoSplitter({
            orientation: "horizontal",
            panes: [{
                size: "240px",
                collapsible: true,
                scrollable: true
            }]
        }).data("kendoSplitter");
 
        kpbContent = $("#linkPanel").kendoPanelBar().data("kendoPanelBar");
        kpbContent.append([
            {
                text: "Additional Dashboards",
                content: "<a href='/DistrictEWSDashboard/'><img src='/assets/images/EWS District TN.png' />         <a href='/admindashboards/'><img src='/assets/images/EWS School TN.png' />         </a><a href='/StudentEWSDashboard/'><img src='/assets/images/EWS Student.png' />         </a><a href='/AdminDashboards.aspx/'><img src='/assets/images/Portal-big.png' /></a>"
            }
         ]);
 
        kpbContent = $("#panelBar").kendoPanelBar().data("kendoPanelBar");
        kpbContent.element.find("#comparativeDashboardPanelContents").css("height", "1104px");
 
        kpbContent.element.find("#gridPane").css("height", "770px");
 
        kpbContent.expand(kpbContent.element.find("li:first"));
 
        kgSecurityGrid = $("#securityGrid").kendoGrid({
            scrollable: true,
            columns: [
                    { field: "Username", title: "User Name", width: 150, editable: false },
                    { field: "FreeReduced", title: "Free and Reduced", width: 50 },
                    { field: "SpecEd", title: "Spec Ed", width: 60 },
                    { field: "Discipline", title: "Discipline", width: 50 },
                    { field: "Assessment", title: "Assessment", width: 50 },
                    { field: "Activities", title: "Activities", width: 50 },
                    { command: ["destroy"], title: " ", width: "172px" },
                    ],
 
            dataSource: {
                transport: {
                    read: function (options) {
                        if (!(kgSecurityGrid)) {
                            options.success([]);
                            return;
                        }
                        kendo.ui.progress(kgSecurityGrid.element, true);
                        $.getJSON(Helpers.toServicesUrl("/GetctrlSecurityInfo"),
                                 {
                                     userName: WSIPCContext.UserName,
                                     districtId: WSIPCContext.DistrictId
                                 },
                                function (data) {
                                    options.success([]);
                                    kgSecurityGrid.dataSource.data(data.GetctrlSecurityInfoResult.RootResults);
                                }).always(function () {
                                    kendo.ui.progress(kgSecurityGrid.element, false);
                                });
 
                    },
                    update: function (options) {
                        if (!(kgSecurityGrid)) {
                            //                            options.success([]);
                            //                            return;
                        }
                        kendo.ui.progress(kgSecurityGrid.element, true);
                        $.postJSON(Helpers.toServicesUrl("/GetupdateSecurityInfo"),
                                                         {
                                                             userName: WSIPCContext.UserName,
                                                             districtId: WSIPCContext.DistrictId,
                                                             UserToUpdate: "wise\lhedman",
                                                             Role: "Teacher",
                                                             FnR: "yes",
                                                             SpecEd: "yes",
                                                             Assess: "yes",
                                                             Discipline: "yes",
                                                             Activites: "yes",
                                                             MSDAdmin: "no"
                                                         },
                                                        function (data) {
                                                            options.success([]);
                                                            //                                    kgSecurityGrid.dataSource.data(data.GetupdateSecurityInfoResult.RootResults);
                                                        }).always(function () {
                                                            kendo.ui.progress(kgSecurityGrid.element, false);
                                                        });
 
//                                                        type: "POST"
                    }
 
 
 
 
                },
                sort: {
                    field: "Username",
                    dir: "asc"
                },
                schema: {
                    model: {
                        fields: {
                            Username: { type: "string", editable: false },
                            FreeReduced: { type: "string" },
                            SpedEd: { type: "string" },
                            Discipline: { type: "string" },
                            Assessment: { type: "string" },
                            Activities: { type: "string" }
 
                        }
                    }
                },
                pageSize: 15,
                batch: true,
                page: 1
            },
            pageable: true,
            sortable: true,
            groupable: true,
            filterable: true,
            resizable: true,
            height: 760,
            toolbar: ["create", "save", "cancel"],
            editable: true
 
        }).data("kendoGrid");
 
        $("#applyFilters").css('display', 'none');
 
        kgSecurityGrid.dataSource.read();
 
    }; //end of initelements
 
    //ACTIONS
    var index = function () {
    };
 
    //  
 
 
    var visitNodes = function (nodes, callback) {
        for (var i = 0; i < nodes.length; i++) {
            callback(nodes[i]);
            if (nodes[i].hasChildren)
                visitNodes(nodes[i].children.view(), callback)
        }
    };
 
    var eachItemToJSON = function (items) {
        var result = new Array(items.length);
        for (var i = 0; i < items.length; i++)
            result[i] = items[i].toJSON();
 
        return result;
    };
 
 
 
 
    function onInitialLoad() {
        //        $("#applyFilters").trigger("click");
 
    };
 
 
    //CALL CONSTRUCTOR
    init();
    //    init1();
 
    //PUBLIC PROPERTIES
    return {
        index: index
    };
});


Srinivasan
Top achievements
Rank 1
 answered on 23 Nov 2016
3 answers
1.6K+ views

Hello,
I am looking at following example and I would like to get the index of the clicked item, how would I do that?

http://dojo.telerik.com/@korchev/amaK

 

Thanks

Alex Hajigeorgieva
Telerik team
 answered on 23 Nov 2016
13 answers
2.6K+ views
I have grid with locked (frozen) column and grouping like this:

http://demos.telerik.com/kendo-ui/grid/frozen-columns

But I have only one frozen column and small width.

And when I group by column with long string values (eg ship address),
these group values in group header displayed in multiple lines.

Screen 1
Screen 2

How show group header in one line even if first part of grid (with locked columns) has small width?

Source example

$(document).ready(function() {
            $("#grid").kendoGrid({
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
                    },
                    schema: {
                        model: {
                            fields: {
                                OrderID: { type: "number" },
                                ShipCountry: { type: "string" },
                                ShipName: { type: "string" },
                                ShipCity: { type: "string" },
                                ShipAddress: { type: "string" }
                            }
                        }
                    },
                    pageSize: 30,
                    group: { field: "ShipName" }
                },
                height: 540,
                sortable: true,
                reorderable: true,
                groupable: true,
                resizable: true,
                filterable: true,
                columnMenu: true,
                pageable: true,
                columns: [ {
                        field: "OrderID",
                        title: "Order ID",
                        locked: true,
                        lockable: false,
                        width: 50
                    }, {
                        field: "ShipCountry",
                        title: "Ship Country",
                        width: 300
                    }, {
                        field: "ShipCity",
                        title: "Ship City",
                        width: 300
                    },{
                        field: "ShipName",
                        title: "Ship Name",
                        width: 300
                    },  {
                        field: "ShipAddress",
                        width: 400
                    }
                ]
            });
        });
Alexander Popov
Telerik team
 answered on 23 Nov 2016
3 answers
425 views

Hi,

We are trying to use the Telerik Testing Studio to automate testing.

We're running into problems testing Kendo UI charts, since there's no way to hook to the series in the chart.

Is there a way to configure the chart to add classes (or ids or any other usable attributes) to each of the series (and to each of the bars in the series in case of stacked bar chart) ?

If not, how can we use your tool to inspect your widgets ?

Thanks in advance

Boyan Dimitrov
Telerik team
 answered on 23 Nov 2016
4 answers
182 views

Hi!, i0m triying to use the event change to capture when user push the Backbutton but the event Change (args e.backButtonPressed) is allways true:

I'm missing something?

The app navigate when user push on link like this <a href="/#previsiones">Previsiones</a>

 

01.SAOO.Routes = function () {
02.    var router = new kendo.Router({
03.        root: "/",
04. 
05.        routeMissing: function (e) {
06. 
07.        },
08.        back: function (e)
09.        {
10.             
11.             
12.            SAOO.theme.page.leftMenu.change(e.url);
13.        },
14.        change: function (e) {
15. 
16.            
17.            if (SAOO.application.loaded==false)
18.            {
19.                SAOO.theme.page.leftMenu.change(e.url);
20.            }
21.             
22.            
23. 
24. 
25. 
26.             
27.        },
28.        root: "/"
29.    });

Thx!!

phx255
Top achievements
Rank 1
 answered on 23 Nov 2016
6 answers
500 views
I am still new to Kendo UI, but so far my experience using the trial version in my ASP.NET MVC project has been positive.
Currently I'm trying to figure out how best to fetch a complete Directory structure (directory on the Server) and use TreeView to show the complete structure (like in Windows Explorer).

I have a Web API Service (still have to figure out this part) that will delivers the complete directory data to HTML client and gets loaded to TreeView finally.
So far after viewing the sample and reading the documentation, I'm still not clear on what approach to use in fetching the data and loading/binding the data to TreeView..
And this is most likely due to my limited knowledge of TreeView at this point.

Is there a more thorough example related to this topic?
I would appreciate any help or advice.

Thanks in advance.
Indy.
Veselin Tsvetanov
Telerik team
 answered on 23 Nov 2016
9 answers
464 views
I must be missing something, but I cannot seem to get a DDL to bind to remote data in the edit template of a listview...

Template and script below... Any help here?
<script type="text/x-kendo-tmpl" id="CompanyTemplateEdit">
    ...
          ...
           
<dt>State</dt>
            <dd>
                <input id="ddlState${CompanyID}" data-bind="value:State" name="State" />
                #renderDDLStates(data)#
             </dd>
            <dt>Postal Code</dt>
            <dd>
                <input type="text" data-bind="value:PostalCode" name="PostalCode" required="required" validationMessage="required" />
                <span data-for="PostalCode" class="k-invalid-msg"></span>
            </dd>
        </dl>                           
    </div>                       
</script>
$(document).ready(function () {
  
            listView.kendoListView({
                dataSource: CompanySource,
                template: kendo.template($("#CompanyTemplate").html()),
                editTemplate: kendo.template($("#CompanyTemplateEdit").html())
            }).data("kendoListView");
        });
  
        var listView = $("#company_list");
          
        var CompanySource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/api/Company/" + $.cookie("C1AuthCompanyID"),
                      
                },
                update: {
                    url: "/api/Company/" + $.cookie("C1AuthCompanyID"),
                    type: "PUT",
                      
                }
            },
            schema: {
                model: {
                    id: "CompanyID",
                    fields: {
                        CompanyID: { editable: false, nullable: true },
                        ParticipantID: { type: "number" },
                        CompanyName: "CompanyName",
                        DBA: "DBA",
                        CompanyNumber: "CompanyNumber",
                        Street1: "Street1",
                        Street2: "Street2",
                        City: "City",
                        State: "State",
                        PostalCode: "PostalCode",
                        isApproved: { type: "boolean" },
                        isActive: { type: "boolean" },
                        isDeleted: { type: "boolean" }
                    }
                }
            }
        });
  
        function renderDDLStates(data) {
            $("#ddlState" + data.CompanyID).kendoDropDownList({
                dataTextField: "stateName",
                dataValueField: "stateCode",
                dataSource: [
                                { stateName: "Texas", stateCode: "TX" },
                                { stateName: "Pennsylvania", stateCode: "PA" }
                ]
            });
        }
Georgi Krustev
Telerik team
 answered on 23 Nov 2016
1 answer
4.9K+ views
hi,

I have a kendo ui grid with toolbar ( with save button ) specified. Not i want to disable the button if the grid contains nothing and when the user clicks it since i'm in the process of processing the request to the server. It is possible? How can i do it? Thanks
Rubens
Top achievements
Rank 2
 answered on 23 Nov 2016
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?