Telerik Forums
Kendo UI for jQuery Forum
1 answer
258 views

Hello everyone,

I am using Kendo 2020.2.513 and I want to do something as in this Dojo: https://dojo.telerik.com/EnuyodAQ

In fact, I am perfectly able to reproduce that code in my project. However, as soon as I change the URL with the one that is providing my data, the code is failing. Data is binded correctly to the spreadsheet, but the next error occurs:

kendo.all.js:139181 Uncaught Error: Shifting nonblank cells off the worksheet is not supported!
at init.insertRow (kendo.all.js:139181)

 

I have even updated the server code to return provide a Jsonp output (so far, it was normal Json). When accessing the data URL directly, with a callback query parameter, the output is consistent with the one in the Dojo example (https://demos.telerik.com/kendo-ui/service/Products?callback=someCallbackFn&_=1234). 

The only difference I can come up with is that, since I am testing locally, my server is serving the content without SSL/TLS (no HTTPS). But I don't think that is relevant at this point. 

Do you have any idea of what can be going on?

 

Veselin Tsvetanov
Telerik team
 answered on 22 Dec 2020
3 answers
252 views

For the past few months, I have been experimenting with React and Material UI and put one very simple application into production.

I am working on my second app which will be an online membership application.  It will need masked inputs for things such as dates, SSN# and credit cards.   This is where Mui started to fall short.   My company already licenses the DevCraft bundle for a WPF project so I started digging into Kendo.  It has all the controls I need and others I didn't even thinks of using.

My initial question isn't about the controls, but to point me in a direction for best practices responsive layout containers.  Mui has Grid (not to be confused with a Data Grid), boxes and Container which helps with that.

It's not clear to me how you do this with Kendo.   Do you have any articles to share.  

 

Thanks

Anthony

Vladimir Iliev
Telerik team
 answered on 22 Dec 2020
2 answers
225 views

I know the original thread got moved to the Feedback Portal, but just in case someone else is looking for a way to do this until it is provided by kendo. When the thread got moved to the portal, this was added: Note: DOM manipulation over SVG elements is not a great approach, and I would not recommend it, unless it is absolutely unavoidable. Unfortunately, there is nothing more reasonable that can be done instead.

Here is a dojo and here is the code:

<!DOCTYPE html>
<html>
<head>
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title>Donut chart with curved series name</title>
 
</head>
<body>
    <div id="example">
    <div class="demo-section k-content wide">
        <div id="chart" style="background: center no-repeat url('../content/shared/styles/world-map.png');"></div>
    </div>
    <script>
        function createChart() {
          var center;
          var caption1;
          var radius1;
          var caption2;
          var radius2;
           
            $("#chart").kendoChart({
                title: {
                    position: "bottom",
                    text: "Share of Internet Population Growth"
                },
                legend: {
                    visible: false
                },
                chartArea: {
                    background: ""
                },
                seriesDefaults: {
                    type: "donut",
                    startAngle: 150
                },
                series: [{
                    name: "Population Growth 2011",
                    visual: function (e) {
                        // Obtain parameters for the segments
                        // Will run many times, but that's not an issue
                        center = e.center;
                        radius1 = e.radius;
                        caption1 = e.series.name;
 
                        // Create default visual
                        return e.createVisual();
                    },
                    data: [{
                        category: "Asia",
                        value: 30.8,
                        color: "#9de219"
                    },{
                        category: "Europe",
                        value: 21.1,
                        color: "#90cc38"
                    },{
                        category: "Latin America",
                        value: 16.3,
                        color: "#068c35"
                    },{
                        category: "Africa",
                        value: 17.6,
                        color: "#006634"
                    },{
                        category: "Middle East",
                        value: 9.2,
                        color: "#004d38"
                    },{
                        category: "North America",
                        value: 4.6,
                        color: "#033939"
                    }]
                }, {
                    name: "spacer1",
                    data: []
                }, {
                    name: "Population Growth 2012",
                    visual: function (e) {
                        // Obtain parameters for the segments
                        // Will run many times, but that's not an issue
                        radius2 = e.radius;
                        caption2 = e.series.name;
 
                        // Create default visual
                        return e.createVisual();
                    },
                    data: [{
                        category: "Asia",
                        value: 53.8,
                        color: "#9de219"
                    },{
                        category: "Europe",
                        value: 16.1,
                        color: "#90cc38"
                    },{
                        category: "Latin America",
                        value: 11.3,
                        color: "#068c35"
                    },{
                        category: "Africa",
                        value: 9.6,
                        color: "#006634"
                    },{
                        category: "Middle East",
                        value: 5.2,
                        color: "#004d38"
                    },{
                        category: "North America",
                        value: 3.6,
                        color: "#033939"
                    }],
                    labels: {
                        visible: false,
                        background: "transparent",
                        position: "outsideEnd",
                        template: "#= category #: \n #= value#%"
                    }
                }],
                tooltip: {
                    visible: true,
                    template: "#= category # (#= series.name #): #= value #%"
                },
                render: function (e) {
                    var chartsvg = $("#example svg");
                    var svg = chartsvg[0];
                   
                    // +5 so not resting right on the donut
                    addCaption(svg, caption1, center, radius1 + 5, false);
                    addCaption(svg, caption2, center, radius2 + 5, true);
                }
            });
        }
 
        function addCaption(svg, caption, center, radius, top) {
            var draw = kendo.drawing;
 
            var text = new draw.Text(caption, [0, 0], {});
            var bbox = text.bbox();
 
            // bump the radius to outside for bottom caption
            var rr = top ? radius : radius + bbox.size.height / 2 + 2;
            var captionsvg = getPath(center, rr, top);
 
            // Unique id
            var id = caption.replace(/\s+/g, '') + Math.random();
            var captionpath = "<path id='" + id + "' fill='transparent' d='" + captionsvg + "' />";
            var captiontext = "<text style='text-anchor: middle;' width='" + bbox.size.width + "'><textpath startOffset='25%' xlink:href='#" + id + "'>" + caption + "</textpath></text>";
            var captionsvg = captionpath + captiontext;
 
            svg.appendChild(parseSVG(captionsvg));
        }
       
        function parseSVG(s) {
            var div= document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
            div.innerHTML= '<svg xmlns="http://www.w3.org/2000/svg">'+s+'</svg>';
            var frag= document.createDocumentFragment();
            while (div.firstChild.firstChild)
                frag.appendChild(div.firstChild.firstChild);
            return frag;
        }
       
        function getPath(center, radius, top) {
            var cx = center.x;
            var cy = center.y;
            var rx = radius;
            var ry = radius;
 
            var sweep = top ? "1 " : "0 ";
 
            var path = "M" + (cx - rx).toString() + "," + cy.toString();
            path += " a" + rx.toString() + "," + ry.toString() + " 0 0," + sweep + (2 * rx).toString() + ",0";
            path += " a" + rx.toString() + "," + ry.toString() + " 0 " + largeArcSweep + (-2 * rx).toString() + ",0";
 
            return path;
        }     
       
        $(document).ready(createChart);
        $(document).bind("kendo:skinChange", createChart);
    </script>
</div>
 
</body>
</html>
Jay
Top achievements
Rank 3
Iron
Iron
Veteran
 answered on 21 Dec 2020
1 answer
457 views

So this is a bit of a strange one.  Have a database where items are stored in float due to the variance of the decimal points.  So you will commonly find scientific notation (7e-8 for example).  I am using Inline Editing on the grid and have use this to display the number as a decimal:

{
                field: "testValue",
                title: "Value",
                width: 100,
                editor: customNumberEditor,
                template: "#= kendo.toString(testValue, 'n' + schemeNomRes)#"
}

 

However, when you click the Edit Button in the row.  The text field reverts back to Scientific Notation.  My function for customNumberEditor is pretty basic:

function customNumberEditor(container, options) {
    $("<input required name=\"" + options.field + "\" onkeypress= \"return isNumber(event)\">").appendTo(container);
}

Is there something I could do there to ensure that the number appears in my textbox as: 0.00000008 in this example?

Thanks,

Richard

Nikolay
Telerik team
 answered on 21 Dec 2020
1 answer
7.5K+ views

I'm trying to create a simple search box  that will search in all the fields found within the grid.

I tried using the filterable option to get a search box. But I ended up getting search box/operators for every single column. All I want is a single search box in my grid that searches through all columns/fields. How can I do this? Also I setting the showOperators false for specific columns didn't work for me. The operators are always visible.

I can post additional code if necessary but it's out of context for the problem I'm experiencing.

<p></p><p>filterable: {<br>     mode: 'row',<br>    showOperators: false<br>}</p>

 

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 21 Dec 2020
2 answers
289 views

We intend to upgrade jQuery 3.4.1 to 3.5.1 but wanna keep current kendo UI is 2019.3.917.

Can we do that? Or must KendoUI be upgraded?

Minh
Top achievements
Rank 1
 answered on 21 Dec 2020
1 answer
157 views

Hi ,

I am facing the below issue.

When i click the span tag with enter key in keyboard the kendo tool tip is not opening. Below is the code

 used in Kendo tool tip .showon(Tooltipshowonevent.Click).

 

Thanks

Mohammed

 

Anton Mironov
Telerik team
 answered on 21 Dec 2020
3 answers
230 views

How do you data bind items. 
We can bind value like so:

data-bind="value: value"

but cannot bind to an array of items in the same manner. 

data-items="items" also doesn't seem to work.

Ivan Danchev
Telerik team
 answered on 21 Dec 2020
1 answer
529 views

I am developing video streaming using Kendo UI Media Player in HTML 5.

 

For back-end I am using Java, Spring framework, JPA, and Hibernate. Firstly, the service in the backend will send a list (array) of the web service URL to get each video. After that, the screen (web page) will show the video playlist, the video will be played based on the video clicked by user.
When user click the video in the playlist, the screen will assign a Service URL to get video as a source for Kendo UI Media Player. The content type for Service Output is application/octet-stream. The code below is JavaScript code to switch between videos in the playlist.

 

Example for Service URL: http://10.25.88.36:800/ns/listen/D03042020LNB0000901_EKYC01_20200304100308_cust.webm

 

function toggleActiveVideo(dataItem) {
    var mediaPlayer = $("#mediaplayer").data("kendoMediaPlayer");
 
    // Data item is Web Service URL to get the video data as application/octet-stream
    // Data item have structure like { title: "[File Name]" , poster: "/images/video.jpg" , source: "[Web Service to get Video Data]"  }
    mediaPlayer.media(dataItem);
 
    $("li.k-state-selected").removeClass("k-state-selected");
    $("li.k-state-default").eq(currentIndex).addClass("k-state-selected");
}

For the Response Headers of the service look like the image below.

 

Response Headers Image

For the Java code in the service look like this:

 

@RequestMapping(value="/ns/listen/{fileNm:.+}")
public StreamingResponseBody listenVoice( @PathVariable(value="fileNm") String fileNm, HttpServletRequest req, HttpServletResponse response   ) throws Exception {
    logger.debug("#### /ns/listenVoice [{}] start ####", fileNm);
 
    if (StringUtil.isBlank( fileNm ))
    {
        throw new InoanException("999999999", "Not Input File Name");
    }
 
    File rtnFile = null;
 
    if(StringUtil.endsWith(fileNm, ".mp4") || StringUtil.endsWith(fileNm, ".webm"))
    {
        rtnFile  = cnccUtil.getVideoFile(fileNm);
 
        if( rtnFile == null )
        {
            rtnFile = cnccUtil.getEkycVideoFile(fileNm);
        }
 
        //response.setContentType( "video/mp4" );
        response.setContentType( MediaType.APPLICATION_OCTET_STREAM_VALUE );
        response.setHeader("Content-Disposition", "attachment; filename="+fileNm);
    }
    else if( StringUtil.endsWith(fileNm, ".mp3") || StringUtil.endsWith(fileNm, ".wav") )
    {
        rtnFile  = cnccUtil.getVoiceFile(fileNm);
        //response.setContentType( "audio/mpeg3" );
    }
 
    //InputStream in = FileUtils.openInputStream(rtnFile);
    final InputStream is = new FileInputStream(rtnFile);
 
    return os -> {
        readAndWrite(is, os);
    };
}
 
private void readAndWrite(final InputStream is, OutputStream os) throws IOException {
    byte[] data = new byte[2048];
    int read = 0;
 
    while ((read = is.read(data)) > 0) {
        os.write(data, 0, read);
    }
 
    os.flush();
}

The video streaming can be played, but can't move video time forward or backward.

Should I change Content Disposition or Content Type in the response headers? Or there's another way to do video streaming using Kendo UI?

Note: the video mime is video/webm; codecs="vp8, opus"

Viktor Tachev
Telerik team
 answered on 18 Dec 2020
1 answer
258 views

Hi,

I'm using TreeList kendo component and there's a case when I need to force refresh of the whole tree node (sometimes it might have quite deep nesting level) and that's causing UI freeze for up to a few seconds.

I'm using the KendoTreeList API like:

```

treeList.kendoTreeList({

            expand: function (e) {

                    this.dataItem(e.model).loaded(false);
              }

})

```

I tried profiling this code and found out that lots of rendering calls (like removeChildData(), removeItems()) is happening during the freeze. As I understand, kendo is cleaning up the subnodes and it takes a while. Is there a way to force refresh of a single node more efficiently? Any help would be appreciated.

Tsvetomir
Telerik team
 answered on 17 Dec 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?