Telerik Forums
Kendo UI for jQuery Forum
0 answers
5 views

I am trying to call a function from the javascript from filter. If I try to filter the column , the function is not being called. There is no any error in console and the value is coming into the grid. But just that trigger is not called when filter the column. Also I wondering  if I remove the function from the script , it will look for the function and will give the error function not found. But if there is function, it will not call the function and alert message is not getting 
We are using the latest version of Kendo Telerik grid. Why the filterable.UI does not work in Asp.net core MVC? How can I find the reason why it is not called?

 

Here is my code



columns.Bound(e => e.City)
                .Filterable(filterable => filterable.UI("cityFilter"))
                .Width(200);

<script type="text/javascript">
    

 function cityFilter(element) {
        alert('testting'
    }
</script>


Pol
Top achievements
Rank 1
Iron
 updated question on 14 Mar 2024
1 answer
8 views

Hello Kendo Experts,

I'm currently working on integrating a Kendo JQuery Grid with an ASP.NET Core server-side setup that utilizes Fluent Validation for data validation. When submitting data via the grid, the server responds with a structured error message in case of validation failures, following this format:

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "|30c76381-41abcc1635c93e3c.",
    "errors": {
        "ProductId": [
            "'ProductId' must not be empty."
        ],
        "Quantity": [
            "'Quantity' must not be empty.",
            "'Quantity' must be greater than '0'."
        ]
    }
}



My goal is to handle these validation errors and present them to the user in a user-friendly manner within the Kendo Grid interface. This involves processing the error messages received from the server and displaying them near the corresponding input fields for easy identification and correction by the user.

Could you kindly provide guidance or suggestions on how to achieve this? Any insights or examples on how to format and display these error messages effectively within the Kendo Grid would be greatly appreciated.

Thank you for your assistance.

Martin
Telerik team
 answered on 14 Mar 2024
0 answers
5 views

I have a model DateTime property called CreatedDate and If I try to filter by date  using the filter 'Is equal to' for a single date, it will not filter the records for the given date due its time part in it filter checking. So How can I make it filter truncating the time part from the filter ?
Pol




public class EmployeeViewModel

{

public string Name{get; set;}

public DateTime  CreatedDate{get; set;}

}

In Kendo Grid
column.Bound(c=>c.CreatedDate).Title("Created Date")

Pol
Top achievements
Rank 1
Iron
 asked on 14 Mar 2024
0 answers
7 views

I am trying to sort alphabetically string values inside the multi filter combobox in Kendo Grid to filter. Now it shows randomly there is no any order in mvc. Here is the code


columns.Bound(c => c.EmpName).Title("Employee Name")
.Filterable(filterable => filterable
.Multi(true)

Pol
Top achievements
Rank 1
Iron
 asked on 13 Mar 2024
1 answer
12 views
 

I am trying to create a multifilter from enum data type column using the ItemTemplate. But ItemTemplate Javascript function is not being called and data is not being shown in combobox. Please can you give me a help. Here is the code

Enum Records

public enum EmpTypes
{
    [Display(Name = "Service")]
    Service = 0,
    [Display(Name = "Sales")]
    Sales = 1,
    [Display(Name = "Purchase")]
    Purchase = 2,
    [Display(Name = "Office")]
    Office = 3
}

Kendo Grid

columns.Bound(c => c.EmpTypes).Title("Type")
        .Filterable(filterable => filterable
            .Multi(true)
            .UI(“”).DataSource(s=>s.Read(r=>r.Action(“GetEmpTypes”,”Report”)))
            .ItemTemplate(“typetemplate”));
<script>
 function typetemplate(e)
{
  alert('Test');
}

</script>
Action Method in MVC controller

Public ActionResult GetEmpTypes()
{
 List<EmpType> emptypes = new List<EmpType>();
emptypes.Add(EmpType.Sales)
emptypes.Add(EmpType.Report)
return Json(emptypes,JsonRequestBehavior.AllowGet);
}


 

Mihaela
Telerik team
 answered on 13 Mar 2024
1 answer
13 views
0

I have an Enum Model called TargetType and ReportViewModel. All the records from the Report table is listing in a kendo grid using the viewmodel ReportViewModel. But the problem is If I try to filter the enum type column 'EmpTypes' it will break the application and cannot filter it. How can I make it filter the column EmpType in Kendo?

 
public enum EmpTypes
{
[Display(Name="Service")
Service = 0,
[Display(Name="Sales")
Sales = 1
[Display(Name="Purchase")
Purchase = 2,
[Display(Name="Office")
Office = 3
}
public class ReportViewModel
{
public string Name {get;set;}
public EmpTypes EmpTypes {get;set;}
}

The Report Table consists the following record

{Name = "AbC",  EmpTypes = 1},
{Name = "xyz",  EmpTypes = 2},

In ReportController GetEmpTypes() , I am fetching the data into Kendo

IQueryable<Report> reportquery = dbContext.Reports;
var kendoList = reportquery.Select(r=>new ReportViewModel()
{
Name = r.Name,
EmpTypes = r.EmpTypes
});
return kendolist.ToDataSourceResultAsync(request);

In Kendo Grid

Columns(columns =>
{
    columns.Bound(c => c.Name).Title("Report Name");
    columns.Bound(c => c.EmpTypes).Title("Type")
        .Filterable(filterable => filterable
            .Multi(true))
            .DataSource(dataSource => dataSource
                .Read(read => read.Action("GetEmpTypes", "Report"))
            )
        );
})

Anton Mironov
Telerik team
 answered on 11 Mar 2024
2 answers
9 views

Hello,

I am currently using Kendo version 2024.1.130 with ASP.NET core Razor Pages.

In this version I am unable to get a sum aggregate to show. Nothing woks, not even a "ABC" string. The footer is visible and all columns contain a &nbsp;

Relevant Code:

@(Html.Kendo().Grid<ItemViewModel>()
    .Name("grid")
    .Filterable()
    .Sortable()
    .Scrollable()
    .Columns(columns =>
    {
        //...
        columns.Bound(c => c.ExtendedPrice).Title("Extended Price").Format("{0:n0}").ClientFooterTemplate("#=sum#");
        //...
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Aggregates(aggregates =>
        {
            aggregates.Add(p => p.ExtendedPrice).Sum();
        })
        .Read(read => read.Action("GetList", "Bom").Type(HttpVerbs.Get).Data("getParameters"))
        .Events(e => e.Error("showSimpleModelStateErrors").RequestStart("clearErrors").RequestEnd("gridDataLoaded"))
    )

Cristian-Leonard
Top achievements
Rank 1
Iron
 answered on 07 Mar 2024
1 answer
27 views

Hello,

We have upgraded our Kendo jQuery package. The previous version was 2019.1.220 and our latest version is 2023.3.1114. We observed that

  • Some classes were changed in the new js say buttons in the kendo grid.
  • Some CSS files are removed. (Assuming it is not compatible with the current version.

After upgrading some of our css are not getting applied. Attaching the screenshots for reference. I'm attaching my sample code.

Below are the stylesheets I'm using
<link href="{{ URL::asset('css/boostrap_v4_alpha.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ URL::asset('kendo/styles/material-main.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ URL::asset('kendo/styles/font-icons/index.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ URL::asset('kendo/styles/bootstrap-main.css') }}" rel="stylesheet" type="text/css">
Please help me if there is something I've missed while upgrading kendo.
Nikolay
Telerik team
 answered on 04 Mar 2024
1 answer
15 views

greetings,

I am currently migrating from kendo version 2015.2.902 to 2023.1.314 for some of the company's core applications and I have the following problem.

When adding the create command to any grid, adding a new row is not working, if I disable the following code in the ondatabound event

function onGridDataBound() {
    /*$('.k-grid-add').unbind("click");*/

    $('.k-grid-add').bind("click", function () {
        if (esModuloAtributos() && configuradorUtils.mode === "edit") {
            setKendoDropDownInitSelection("xxxx");
            setKendoDropDownInitSelection("xxxxx");
        } else if (esModuloAgrupaciones() && configuradorUtils.mode === "edit") {
            setKendoDropDownInitSelection("xxxx");
            setKendoDropDownInitSelection("xxxxxx");
        }
        $("#Todos").prop("checked", false);
        return validaFiltros();
    }); 
}

The grid works to create and add the new row, but it does not maintain the functionality that if x condition is met it should add the row.

Nikolay
Telerik team
 answered on 27 Feb 2024
1 answer
12 views

Hi there,

Currently I try to export data from a grid with details, however when I trigger the event export the UI generate the next error.

Code: In this object we have the data.

The code run until at the end and after this is the message.

I am using the documentation and examples, but dont works too.

https://docs.telerik.com/kendo-ui/knowledge-base/detail-grid-export

Another thing I reviewed that work with angular.

Thank you for your help !

 

 

 

Peter Milchev
Telerik team
 answered on 27 Feb 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?