Kendo UI grid with multiple values


nyn3x

I want to add kendo-ui-grid to my page which should contain columns with multi-values.

Imagine the following data:

| Name   | Tag                 |
|--------|---------------------|
| John   | C#, JavaScript, PHP |
| Oliver | UI, SQL             |
| Mark   | SQL, Windows Server |

This tagcolumn is the actual label array.

Ultimately, I'd like to be able to filter all records that contain tags sql.

Is it even possible using kendo-ui?

don't vote

Try the following grid settings:

var grid = $("#grid").kendoGrid({
    dataSource: {
    data: [
        { name: "John", tags: ["C#", "JavaScript", "PHP"] },
        { name: "Oliver", tags: ["UI", "SQL"] },
        { name: "Mark", tags: ["SQL", "Windows Server"] }]
    },
    columns: [{
        field: "name",
        title: "Name"
    }, {
        template: "# var t=tags.join(', '); data.tagsString=t; # #=t #",
        title: "Tags",
        field: "tags"
    }]
}).data("kendoGrid");

$("#filter").on("keydown", function() {
    grid.dataSource.filter({ 
        field: "tagsString",
        operator: "contains", 
        value: $(this).val()
    });
});

demo .

As you can see I have to use an external custom filter field. That's because the grid's default built-in column filter doesn't filter arrays, nor the dataSource's filter()methods.

So in the template I have kendo create a new property in each dataSource item called tagsString, and I set the result to be the same as shown in the tags.join(", ")" label" column . Once that property is set, I can filter using the filter()method , which will be set fieldto tagsString.

Related


Kendo UI grid with multiple values

nyn3x I want to add kendo-ui-grid to my page which should contain columns with multi-values. Imagine the following data: | Name | Tag | |--------|---------------------| | John | C#, JavaScript, PHP | | Oliver | UI, SQL | | Mark

Kendo UI grid filter column with multiple values

Bryan Schmiedeler I've been using filters to successfully search on my KendoUI grid. However, some fields of the new app have multiple values, so my filtering doesn't work - in fact it seems to spin forever. Example of a multivalued field: field : "rspPerson

Kendo UI grid filter column with multiple values

Bryan Schmiedeler I've been using filters to successfully search on my KendoUI grid. However, some fields of the new app have multiple values, so my filtering doesn't work - in fact it seems to spin forever. Example of a multivalued field: field : "rspPerson

Kendo UI grid filter column with multiple values

Bryan Schmiedeler I've been using filters to successfully search on my KendoUI grid. However, some fields of the new app have multiple values, so my filtering doesn't work - in fact it seems to spin forever. Example of a multivalued field: field : "rspPerson

Kendo UI grid filter column with multiple values

Bryan Schmiedeler I've been using filters to successfully search on my KendoUI grid. However, some fields of the new app have multiple values, so my filtering doesn't work - in fact it seems to spin forever. Example of a multivalued field: field : "rspPerson

Kendo UI grid filter column with multiple values

Bryan Schmiedeler I've been using filters to successfully search on my KendoUI grid. However, some fields of the new app have multiple values, so my filtering doesn't work - in fact it seems to spin forever. Example of a multivalued field: field : "rspPerson

Kendo Angular Grid Filter for UI Values

fanaticism I'm using Angular 7's Kendo UI and filtering works most of the time, but I can't figure out one thing. I have some fields that are piped to make the UI more user friendly. For example, I have a code in my object that specifies a software. When it's

Kendo Angular Grid Filter for UI Values

fanaticism I'm using Angular 7's Kendo UI and filtering works most of the time, but I can't figure out one thing. I have some fields that are piped to make the UI more user friendly. For example, I have a code in my object that specifies a software. When it's

Multiple elements in a single grid in kendo UI

Manikonda I want to add two buttons to a single dialog in kendo UI GRid. Could be helpful on how to do this. Html.Kendo().Grid<Employeeentity>() .Name("grid") .Columns(columns => { columns.Command(command => command.Custom("Button1name").Click("

Multiple elements in a single grid in kendo UI

Manikonda I want to add two buttons to a single dialog in kendo UI GRid. Could be helpful on how to do this. Html.Kendo().Grid<Employeeentity>() .Name("grid") .Columns(columns => { columns.Command(command => command.Custom("Button1name").Click("

How to display ellipsis for long cell values in kendo ui grid?

submarine I am trying to display ellipsis for long values in a kendo grid. According to the Telerik forum, I need to set in CSS .k-grid td { overflow: hidden; text-overflow: ellipsis; } I'm trying to style the grid's data bound event like this var grid = $("#

Using column.values with row templates in Kendo UI Grid

mundane I'm using a Kendo grid with a custom row template and I have values defined for one column. The popup editor shows the dropdown correctly, but the grid still shows the id field. code: <script id="usersTableRowTemplate" type="text/x-kendo-tmpl"> <tr

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI Grid Hierarchy

Ivan Crojach Karačić What I have is the following DTO passed from the service class ServiceDto { public string Name { get; set; } public string Complete { get; set; } public string Incomplete{ get; set; } public List<ServiceDto> Detail{ get

Kendo UI Grid Hierarchy

Ivan Crojach Karačić What I have is the following DTO passed from the service class ServiceDto { public string Name { get; set; } public string Complete { get; set; } public string Incomplete{ get; set; } public List<ServiceDto> Detail{ get

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI - Tooltips in Grid

no time I am trying to create a tooltip for my grid like this: $("#grid").kendoTooltip({ autoHide: true, showOn: "mouseenter", width:125, height:125, position: "right", filter: ".k-grid-content a.hasTooltip", content: kendo.template

UI unresponsive to Kendo grid

Charvari I've been having issues with kendo grids for the following situations. I have a kendo grid with 18 columns. The user can select multiple rows. The number of rows is mostly over 10000. To get the selected row, I am using grid.select(). To extract conte

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI Grid Hierarchy

Ivan Crojach Karačić What I have is the following DTO passed from the service class ServiceDto { public string Name { get; set; } public string Complete { get; set; } public string Incomplete{ get; set; } public List<ServiceDto> Detail{ get

Kendo UI - Tooltips in Grid

no time I am trying to create a tooltip for my grid like this: $("#grid").kendoTooltip({ autoHide: true, showOn: "mouseenter", width:125, height:125, position: "right", filter: ".k-grid-content a.hasTooltip", content: kendo.template

UI unresponsive to Kendo grid

Charvari I've been having issues with kendo grids for the following situations. I have a kendo grid with 18 columns. The user can select multiple rows. The number of rows is mostly over 10000. To get the selected row, I am using grid.select(). To extract conte

Kendo UI Grid display multiple fields in single column

User 3904868 I'm trying to display multiple fields in a single cell in an ASP.NET MVC Kendo Razor grid i tried it all columns.Template(@<text>@item.Field1 @item.Field2</text>).Title("Test"); and columns.Bound(c => new {x = c.Field1, y = c.Field2}).Template(@<t

Kendo UI Grid multiple choice drag and drop issue

ankush inna I have a kendo grid and I am using multiselect drag and drop in it. When I click on the row/record and drag it to another grid, it shows some shadows and it doesn't look good. I do not know why it has to be like this. I want to remove this shadow.

Kendo UI Grid multiple choice drag and drop issue

ankush inna I have a kendo grid and I am using multiselect drag and drop in it. When I click on the row/record and drag it to another grid, it shows some shadows and it doesn't look good. I do not know why it has to be like this. I want to remove this shadow.

Kendo ui grid (if other conditions)

pilot What's wrong with my code? I have to check in the kendo UI grid if there is "OrderType 20" in the column. If so, I need to apply the css condition that includes the background, but it doesn't work, can anyone help me? thanks template: '# if (OrderType ==