Telerik Forums
Kendo UI for jQuery Forum
3 answers
1.3K+ views

Hi Telerik folk,

Once upon a time, I stumbled upon on an undocumented "feature" - Kendo Grid template take javascript function as value. e.g:

{
    // taking function as value
    template: function(data) {
        return "Name: " + data.name;
    },
    // string template
    template: "Name: #: name#",
}

I vaguely remember reading somewhere (in this forum?) there is a performance different between passing a function to template option vs passing string version. Can you confirm that? If so, how (is it memory usage? CPU? rendering time?) and why? We are finding this "template function" to be very convenient and want to use it more, but want to know if and what price we pay for it.

Thanks you.

Stamo Gochev
Telerik team
 answered on 20 Jun 2017
3 answers
945 views

I create a TabStrip something like this, where "#myStrip" is set up to have a bunch of tabs, all loaded with Ajax.  After it is initialized, I immediately call select() to set the default tab

var widget = $('#myStrip').kendoTabStrip({
      // contentUrls set up here, etc.
}).data('kendoTabStrip');
 

// widget.activateTab(3);     // doesn't help?

var retval = widget.select(3);    // async?
var selected = widget.select();

 

With the Ajax loading, I think the sequence is:

  1. My code makes the widget.select(3) call
  2. "select" event fires
  3. tabstrip retrieves ajax content for tab index=3
  4. the content is inserted, and a script in the content is executed, tries to do a select() on the tabbar
  5. "contentLoad" event fires
  6. "activate" event fires

My problem is that during (3), a script on the ajax-loaded content wants to check what tab is selected.  It does something like $('#myStrip').data('kendoTabStrip').select(), but the select() getter doesn't actually return anything (0-length jquery object).  My guess is that the initial select(...) setter in (2) hasn't actually finalized setting whatever internal variable it stores the current tab info in.  It only does that sometime between (4) and (5), and for anything that calls select() before that, like my ajax content initializing at (4), the widget doesn't return what will be the tab element shortly.

I tried using "activateTab()" instead to avoid triggering the "select" event, but select() still doesn't seem to return anything until after the contentLoad/activate events have fired.  I could probably have the ajax-content stash a function that does what I want, and have a contentLoad handler call that function so that select() would be valid by that point, but I'd like to avoid that if possible.  Do I have to assume that it is not legit to do select() during the content loading process, before it has finished and fired "contentLoad"?

I tried to modify the ajax demo as an example, but there wasn't an easy way to provide my own custom ajax tab content with a script that called select().

Dimitar
Telerik team
 answered on 20 Jun 2017
9 answers
867 views

Hi,

few days ago DatePicker and CurrencyTextBox stopped working in Chrome when version 56. has been realesed.

Date picker and currency text box are not binded any more, there is no value displayed.

I checked out the console messages and I found there following 2 messages 

The specified value "2.1.2017." does not conform to the required format, "yyyy-MM-dd".

The specified value "10000,00" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?

Everything works fine in other browsers Chrome ver. 55, Firefox or IE, without these console message.

Version of Kendo is 2013.3.1324.

Can you explain why this happened in new versions of Chrome and how can we easily fix this serious issue?

Thanks,

Aljosa

Tsvetina
Telerik team
 answered on 20 Jun 2017
1 answer
192 views
How to set the border color of a Area chart in MVVM?

 

<div data-role="chart"
 data-legend="{ position: 'bottom' }"
 data-series-defaults="{ type: 'area' }"
 data-series-colors="['#A2A2A2']"
 
 data-series="[
                 { field: 'id', name: 'id' , labels: {visible: true},line: {style:'smooth'}}
             ]"
 
 data-bind="source: sourceId,
            events: { seriesHover: onSeriesHoverIndex }"
 style="height: 250px;" >
Daniel
Telerik team
 answered on 20 Jun 2017
4 answers
1.0K+ views
How to change the color of a grid column in MVVM?
i would like something like this:
first column: green
second column: yellow

    <div data-role="grid"
                 data-toolbar="DOC"
                 data-columns="[
                                 { 'field': 'doc1'},
                                 { 'field': 'doc2' }
                              ]"
                 data-bind="source: sourceList"></div>
Federico
Top achievements
Rank 1
 answered on 19 Jun 2017
1 answer
410 views

Hi,

In the demos of the editor (Proxy target demo) we need to export the pdf that we have ( i already set the proxy and is working) to a new window/tab just like the example says:

pdf: {       forceProxy: true,     
               proxyURL: "/save",    
               proxyTarget: "_blank"
}

EXAMPLE - OPEN THE GENERATED DOCUMENT IN A NEW WINDOW

In the editor it open the pdf in the same window  . You can see that in the example in the Dojo . 

This same example but in the scheduler ( scheduler demo)  works fine and it open like it says it does.

is this a bug or how should i do to open the pdf in a new window using the editor?

thanks in advance

Dimitar
Telerik team
 answered on 19 Jun 2017
1 answer
343 views
$scope.mainGridOptions = {
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Employees"
                    },
                    pageSize: 5,
                    serverPaging: true,
                    serverSorting: true
                },
                sortable: true,
                pageable: true,
                dataBound: function() {
                    this.expandRow(this.tbody.find("tr.k-master-row").first());
                },
                columns: [{
                    field: "FirstName",
                    title: "First Name",
                    width: "120px"
                    },{
                    field: "LastName",
                    title: "Last Name",
                    width: "120px"
                    },{
                    field: "Country",
                    width: "120px"
                    },{
                    field: "City",
                    width: "120px"
                    },
                           {
                           field:"urlList",title:"url",
                           template:"<a href="#=urlList[0]#">#=urlList[0]#</a>"
                           }
 
            ]};

 

Here in the "Url" Column(italic one)  i want to show a list of comma seperated urls .For the time being i'm only able to show the first one. Is there any way i could show all the urls seperated by a comma so that each will open a seperate link.

 

Georgi
Telerik team
 answered on 19 Jun 2017
4 answers
233 views

I have several tables that have different numbers of columns, but I want to columns widths of the tables to be the same.

I have achieved this by setting all the columns widths, but with one empty column at the end (without a column width) - see attached image. What is the best way to do this, without having to add any empty columns?

Georgi
Telerik team
 answered on 19 Jun 2017
7 answers
134 views

I use the Kendo with AngularJS. I define the datasource for my drop-down-list during initialization of the page, together with other options and define it via k-options.
In other places it works fast, on the desktop, android devices and so on.  But when I touch on the drop-down-list on my IPad first time, the delay occurs around 2-3 seconds. Then of course it works fast.

 

How can I reduce a delay by the first touch? 

Tsvetina
Telerik team
 answered on 19 Jun 2017
1 answer
234 views

Is it possible to show an icon or button "within" the diagram (say at the top right) that allows the person to export to PDF?

It would help with our layout if such an icon/button could be part of the diagram itself if that makes any sense?

Konstantin Dikov
Telerik team
 answered on 19 Jun 2017
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?