Telerik Forums
Kendo UI for jQuery Forum
1 answer
233 views

Hi - we use MVVM binding al lot in our kendo application.

Are there any samples / help pages that list the attribute names to use when declaring a TileLayout in MVVM style ?

Something similar to the information presented on this page: https://demos.telerik.com/kendo-ui/mvvm/widgets

Regards

Tom

Mihaela
Telerik team
 answered on 11 Mar 2021
1 answer
135 views

I have this code below

$("#numeric").kendoNumericTextBox({
                      min: 1,
                        max: 100,
                      decimals: 0,
                      format: "# pieces",
                      spinners: true,
                      restrictDecimals: true
                    });

 

My problem is that if user enter "0", then tab out, value changes to "1" only, not "1 pieces"

So it does not follow the format if the entered value is below the min. No problem if value is more than max.

My version is "2018.3.1017", upgrade is not an option.

Do you have a workaround on how to force to change the display value with format (may be on the onblur event perhaps)?

Mihaela
Telerik team
 answered on 11 Mar 2021
3 answers
736 views
good morning everyone,

I am currently using the licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012) and trying to figure out if the Kendo UI Grid has something similar to the DataKeys method in the Telerik Extensions for ASP.NET MVC Grid?

Before this, I was using the licensed version of Telerik Extensions for ASP.NET MVC.  Below is the code I had for it.  You'll notice, there is a "DataKeys" method which I can associate the "Id" property of the Model, to each row of the Grid. 

@{Html.Telerik().Grid(Model)
    .Name("grdAllUsers")
    .DataKeys(keys => keys.Add(k =>
        k.Id)
    )
    .Columns(columns =>
    {
        columns.Bound(o => o.FirstName)
            .Width(150);
        columns.Bound(o => o.LastName)
            .Width(150);
        columns.Bound(o => o.EmailAddress)
            .Width(200);
        .Width(70)
        .HtmlAttributes(new { style = "text-align:center" });
    })
    .NoRecordsTemplate(@<text>No User records to display.</text>)
    .Pageable(paging =>
        paging.PageSize(15)
    )
    .Sortable()
    .Filterable()
    .Render();
}


Is there something similar in the Kendo UI Grid???  Below is my current Kendo UI Grid.

@{Html.Kendo().Grid(Model)
    .Name("grdAllUsers")
    .Columns(columns =>
    {
        columns.Bound(o => o.FirstName)
            .Width(150);
        columns.Bound(o => o.LastName)
            .Width(150);
        columns.Bound(o => o.EmailAddress)
            .Width(200);
        .Width(70)
        .HtmlAttributes(new { style = "text-align:center" });
    })
    .Pageable(paging =>
        paging.PageSize(15)
    )
    .Sortable()
    .Filterable()
    .Render();
}

Thank you very much for your help.
Tsvetomir
Telerik team
 answered on 10 Mar 2021
3 answers
377 views

Hello,

we have a TileLayout with a Pie Chart inside. The Pie Chart is diaplaying labels. 

Unfortunately when the tile size is reduced, the labels are cut off (horizontally and vertically).

Is there any way to prevent this.

 

Example:

Reduce the width of the Pie Chart in this dojo: https://dojo.telerik.com/EsOWoqAL

Georgi Denchev
Telerik team
 answered on 10 Mar 2021
4 answers
1.0K+ views

Hi, 

i have a drop down tree created, as shown in the attachment below

i need to checked all the checkboxes by default. How to do this?

Petar
Telerik team
 answered on 10 Mar 2021
5 answers
16.2K+ views

Hi!

I'm trying to make an ajax call to my controller function.
To get all the data that currently are in a grid's datasource.
Instead of calling directly to the grid's datasource.data() which only returns me the current grid page.

I go about this by instantiating a new kendo datasource.
But everything i try, yields "Uncaught TypeError: e.slice is not a function"

Thanks in advance.

public JsonResult ReadTimeRegistrationAjax([DataSourceRequest] DataSourceRequest request)
{
   var dataSourceResult = getStuff().ToList();
   return Json(dataSourceResult.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}

var grid = $("#GridTimeRegistrations").data("kendoGrid");
        var dataurl = grid.dataSource.transport.options.read.url;
 
        var dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: dataurl,
                    dataType: 'json'
                }
            },
        });         
 
        dataSource.fetch(function() {
            var data = dataSource.data();
            console.log(data);
        }

Mark
Top achievements
Rank 1
 answered on 09 Mar 2021
1 answer
322 views

I have an issue and I need someone to see what I'm doing wrong...

I tried to use several times "reorder". I simplify the test to this :

<!-- container templates -->
  <script id="barcelona" type="text/x-kendo-template">
            A
  </script>
 
<script id="sofia" type="text/x-kendo-template">
            B
</script>
 
 
$("#home-super-container").kendoTileLayout({
                containers: [{
                    colSpan: 1,
                    rowSpan: 1,
                    header: {
                        text: "Barcelona"
                    },
                    bodyTemplate: kendo.template($("#barcelona").html())
                }, {
                    colSpan: 1,
                    rowSpan: 1,
                    header: {
                        text: "Sofia"
                    },
                    bodyTemplate: kendo.template($("#sofia").html())
                }],
                columns: 2,
                columnsWidth: 285,
                rowsHeight: 285,
                reorderable: true,
                reorder: function (e) {
                            console.log(e.newIndex, e.oldIndex);
                }
    });

 

The console.log indicates (0 0), it should be (0 1) or (1 0)...

 

Mihaela
Telerik team
 answered on 09 Mar 2021
2 answers
372 views

Hi,

I have a kendo toolbar with multiple dropdowns and checkboxes to filter my datasource. What I want is when I submit my filter selections, if a spesific checkbox is checked, then datetime column of the grid will have this template:

"#= kendo.toString(kendo.parseDate(dates), 'dd/MM/yyyy') #"

If the checkbox not checked (or the page is just loaded with empty checkbox in default scenario) the column will have:

"#= kendo.toString(kendo.parseDate(dates), 'dd/MM/yyyy HH:mm') #"

as template. 

I tried conditioning inside of grid but I didn't manage to obtain checkbox value. I tried writing a function outside the grid function but when I refresh grid data with:

var grid = $("#grid").data("kendoGrid");
grid.dataSource.data(reportData);

it only refresh the data inside grid, that does not trigger the template function.

How can I change the column template while refreshing the data according to that checkboxs value? 

 

Greets Umutcan

Nikolay
Telerik team
 answered on 09 Mar 2021
8 answers
1.7K+ views
When I have a grid that extends below the visible area of the page, clicking on a row causes the page to scroll upward by some arbitrary amount. My attempt to prevent this in the grid change handler is not successful, because the scroll is instantaneous, and happens before the handler is called. I can scroll the page back down within the handler, but this causes a very noticeable 'jump' when a row is clicked. It appears this only happens in Chrome.

I have two questions:

1. why does the page scroll at all when a row is clicked?
2. how can i PREVENT the scrolling entirely, instead of re-scrolling the page back to the original position?

Here's most of the grid definition:

change: onChange,
sortable: {
mode: 'multiple'
},
groupable: true,
filterable: true,
navigatable: true,
resizable: true,
selectable: 'multiple row',

I've searched a bit, and found a few threads with something that sounds similar (http://www.telerik.com/forums/grid-jumps-or-scrolls-to-top-on-row-click), but the claim is that the issue was resolved with 2013.1.417

Can anyone shed some light on this? Many thanks


Tsvetomir
Telerik team
 answered on 09 Mar 2021
2 answers
224 views

I was having some issues with a grid where I was getting an error saying that Description is not field that can be called on a null value, or something along those lines. TimeType is of type TimeTypeViewModel.

public class TimeTypeViewModel
{
    public override string ID { get; set; }
    public override string Description { get; set; }
}

 

columns.Bound(p => p.TimeType).Hidden(true).ClientTemplate("#= (typeof TimeType != 'undefined') ? TimeType.Description : ''#");

 

but the following code doesn't cause me any issues

but code doesn't cause me any issues

columns.Bound(p => p.TimeType).Hidden(true).ClientTemplate("#= typeof TimeType == 'undefined' || TimeType == null ? '' : TimeType.Description #");

 

Why is this? It seems that all the values (i.e. 'TimeType.Description') are being evaluated in the expression before actually checking to see if they should be evaluated based on the inline if condition. Is this a bug? Is this me not understanding how templates work? Is my code somehow bad, or only works on certain types?

carlos
Top achievements
Rank 1
 answered on 09 Mar 2021
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?