Telerik Forums
Kendo UI for jQuery Forum
2 answers
232 views

Hello,

I am using the jquery chat widget as a virtual assistant on the right corner of the page and would like the ability change the message box to a textarea as opposed to an input so all the wording that is outside the scrollable view area is visible.

I see in the angular version of this widget that this is possible, is there a similar feature for the jquery chat version?  Or even the .net Core version?

Thanks,

Arthur

Jeff
Top achievements
Rank 1
Iron
 updated answer on 02 Jul 2024
1 answer
69 views

My web header template pulls a bunch of aggregate data up into the template (with a fontawesome icon), but on the excel export it's coming into the XML AS that html template not the raw innerText I'd expect.

Thoughts?

Martin
Telerik team
 answered on 02 Jul 2024
1 answer
88 views

I have an issue that I have seen others have run into before across the forum, but the threads are generally old and none of the solutions have worked or were not relevant to our situation. We are on a fairly recent version of Kendo UI for jQuery (2 back) and a fairly recent version of jQuery (2 or 3 versions back). 

Basically, we have kendoComboBoxes in a kendoWindow that often, but not always, immediately close the first time that the user clicks the drop down button. After that it works fine - see the attached animated png to see it in action. The ComboBoxes do have filtering enabled and we have seen similar behavior on the DropDownList, and just lived with it.

I have noticed that if I click in the background of the window prior to opening the ComboBox it solves the issue, which leads me to believe that it is some sort of focus problem. I have tried triggering a focus event on the window after the form is initialized (with a delay) and this seems to make it somewhat better, but does not entirely solve the issue.

Has anyone experienced this and solved it?

Thank you for any help!

Martin
Telerik team
 answered on 02 Jul 2024
1 answer
64 views

I would like to know if it's possible to declare a Kendo grid column to display a Kendo grid within it. If so, how can I do this?

This is my code with my attempt (I couldn't find any demo online describing how to do this) that obviously didn't work as expected:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PSWSv3.aspx.cs" Inherits="PAMsKendo.PSWSv3" %>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Getting Started with Kendo UI for jQuery</title>
    <link href="styles/default-main.css" rel="stylesheet" />
    <script src="scripts/jquery-3.7.1.min.js"></script>
    <script src="js/kendo.all.min.js"></script>
    <script src="scripts/kendo-ui-license.js"></script>
  </head>
  <body>

    <div id="ordersGrid">
    <div id="fooGrid"></div>

    </div>

    <script>
        $(function () {
            var myData = [
                {
                    "bulkProjectLineItemID": 1234567,
                    "retailPrice": 123.45,
                    "wholesalePrice": 99.99,
                    "cost": 75.32,
                    "oENumbers": [
                        {
                            "oeNumber": "123456789",
                            "bulkProjectOEMNumberID": 123456
                        },
                        {
                            "oeNumber": "23456789",
                            "bulkProjectOEMNumberID": 123457
                        }
                    ],
                    "interchangeNumbers": [
                        {
                            "interchangeNumber": "120-12345R",
                            "bulkProjectInterchangeNumberID": 123456
                        },
                        {
                            "interchangeNumber": "120-12345L",
                            "bulkProjectInterchangeNumberID": 123457
                        }
                    ]
                },
                {
                    "bulkProjectLineItemID": 1234568,
                    "retailPrice": 123.45,
                    "wholesalePrice": 99.99,
                    "cost": 75.32,
                    "oENumbers": [
                        {
                            "oeNumber": "123456789",
                            "bulkProjectOEMNumberID": 123456
                        },
                        {
                            "oeNumber": "23456789",
                            "bulkProjectOEMNumberID": 123457
                        }
                    ],
                    "interchangeNumbers": [
                        {
                            "interchangeNumber": "120-12345R",
                            "bulkProjectInterchangeNumberID": 123456
                        },
                        {
                            "interchangeNumber": "120-12345L",
                            "bulkProjectInterchangeNumberID": 123457
                        }
                    ]
                }
            ];

            var gridDataSource = new kendo.data.DataSource({
                data: myData,
                schema: {
                    model: {
                        fields: {
                            bulkProjectItems: {
                                fields: {
                                    bulkProjectLineItemID: { type: "number" },
                                    retailPrice: { type: "number" },
                                    wholesalePrice: { type: "number" },
                                    cost: { type: "number" },
                                    oENumbers: {
                                        fields: {
                                            oeNumber: { type: "string" },
                                            bulkProjectOEMNumberID: { type: "number" }

                                        }
                                    },
                                    interchangeNumbers: {
                                        fields: {
                                            interchangeNumber: { type: "string" },
                                            bulkProjectInterchangeNumberID: { type: "number" }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                pageSize: 10
            });


            $("#ordersGrid").kendoGrid({
                dataSource: gridDataSource,
                height: 400,
                width: 1200,
                pageable: true,
                columns:
                    [
                        {
                            field: "bulkProjectLineItemID",
                            title: "Line Item ID",
                            width: 120
                        },

                        {
                            field: "retailPrice",
                            title: "Retail Price",
                            width: 120
                        },

                        {
                            field: "wholesalePrice",
                            title: "Wholesale Price",
                            width: 120
                        },

                        {
                            field: "cost",
                            title: "Cost",
                            width: 120
                        },

                        {
                            title: "OE NUMBERS",
                            width: 200,
                            field: "oENumbers",
                            template: $().kendoGrid({
                                columns:
                                    [
                                        {
                                            field: "oeNumber",
                                            width: 150
                                        },

                                        {
                                            field: "bulkProjectOEMNumberID",
                                            width: 150
                                        }
                                    ]
                            })
                        },

                        {
                            title: "INTERCHANGE NUMBERS",
                            width: 200,
                            field: "interchangeNumbers",
                            template: $().kendoGrid({
                                columns:
                                    [
                                        {
                                            field: "interchangeNumber",
                                            width: 150
                                        },

                                        {
                                            field: "bulkProjectInterchangeNumberID",
                                            width: 150
                                        }
                                    ]
                            })
                        }

                    ]
            });
        });

    </script>
  </body>
</html>

 

Thanks,

Pat

Nikolay
Telerik team
 answered on 01 Jul 2024
1 answer
88 views

When I add the below block of code to Visual Studio, I'm getting a linting warning that resize is deprecated. In my real application, I need to pass true (grid.resize(true)) to it. Is there a way to suppress such warnings or is there a new way of doing this? This code is from this Kendo UI Knowledge Base article: 
Resize and Expand Grid to 100% Height

      function resizeGrid() {
        gridElement.data("kendoGrid").resize();
      }

Nikolay
Telerik team
 answered on 01 Jul 2024
0 answers
120 views

The following grid column definition renders the enum as a string:

columns.Bound(p => p.SomeEnum);

The ajax call actually returns an int for the enum but the grid does some magic and shows the enum string.

If I need to customize the output and use a ClientTemplate, it renders as an int though:

columns.Bound(p => p.SomeEnum).ClientTemplate("foo #=SomeEnum#");

How can I get my ClientTemplate to render the string version of the enum?

Paul
Top achievements
Rank 1
 asked on 28 Jun 2024
1 answer
52 views

Hi, I need to know if there is a way to give an order to the elements that are placed in overlfow.

I would like to decide which elements to send to overflow first, then if there is a lack of space, move on to the other elements and so on.

Thank you!

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 27 Jun 2024
1 answer
64 views
I'm trying to add a column selector to the Kendo Tree List. I have it successfully working in the KendoGrid but when I use it in a treelist, I get a Jquery maximum call stack exceeded error when the kendoFilterMultiCheck is initialized. Do I need to do something differently for a Kendo Grid vs a Treelist? Here is my code:
function initKendoGridNestedColumnSelector(gridId, columnSelectorContainer) {
    if (!columnSelectorContainer) {
        $(`#${gridId}`).before(`<div id="columnChooser_${gridId}" class="column-selector"></div>`);
        columnSelectorContainer = `columnChooser_${gridId}`;
    }

    let grid;
    if ($(`#${gridId}`).hasClass("k-treelist")) {
        grid = $(`#${gridId}`).data("kendoTreeList");
    } else {
        grid = $(`#${gridId}`).data("kendoGrid");
    }

    let visibleColumns = [];
    let includedColumns = [];
    let columns = grid.columns;
    $.each(columns, function (index, column) {
        if (column.columns) {
            $.each(column.columns, function (indexLevel2, columnLevel2) {
                if (columnLevel2.columns) {
                    $.each(columnLevel2.columns, function (indexLevel3, columnLevel3) {
                        if (!columnLevel3.hidden) {
                            visibleColumns.push({ value: columnLevel3.field, operator: "eq", field: "field" });
                        }
                        if (!Object.prototype.hasOwnProperty.call(columnLevel3, "menu") || columnLevel3.menu) {
                            columnLevel3.display = `${columnLevel2.title} ${columnLevel3.title}`;
                            includedColumns.push(columnLevel3);
                        }
                    });
                } else {
                    if (!columnLevel2.hidden) {
                        visibleColumns.push({ value: columnLevel2.field, operator: "eq", field: "field" });
                    }
                    if (!Object.prototype.hasOwnProperty.call(columnLevel2, "menu") || columnLevel2.menu) {
                        columnLevel2.display = `${column.title} ${columnLevel2.title}`;
                        includedColumns.push(columnLevel2);
                    }
                }
            });
        } else {
            if (!column.hidden) {
                visibleColumns.push({ value: column.field, operator: "eq", field: "field" });
            }
            if (!Object.prototype.hasOwnProperty.call(column, "menu") || column.menu) {
                column.display = column.title;
                includedColumns.push(column);
            }

        }
    });
    let chooserDs = new kendo.data.DataSource({
        data: includedColumns,
        filter: {
            filters: visibleColumns,
            logic: "or"
        }
    });
    $(`#${columnSelectorContainer}`).kendoFilterMultiCheck({
        field: "field",
        itemTemplate: function (e) {
            if (e.field == "all") {
                return "<li class='k-item'><label class='k-label'><strong><input type='checkbox' /><span>#= all#</span></strong></label></li>";
            }
            return "<li class='k-item #= data.menu === false ? '' : ''#'><label class='k-label'><input type='checkbox' name='" + e.field + "' value='#=field#'/><span>#= (data.title) ? display : field #</span></label></li>";
        },
        dataSource: chooserDs,
        search: true,
        messages: {
            filter: translateText("Done", "Global"),
            selectedItemsFormat: "{0} " + translateText("Columns Selected", "Global"),
            clear: translateText("Hide All", "Global")
        },
        refresh: function (e) {
            if (e.sender.dataSource.filter()) {
                var columnsToShow = e.sender.getFilterArray();
                $.each(includedColumns, function (i, col) {
                    if (!col.field) {
                        return true;
                    }
                    if (col.field && columnsToShow.indexOf(col.field) > -1) {
                        grid.showColumn(col.field);
                    } else {
                        grid.hideColumn(col.field);
                    }
                });
            } else {
                var columns = includedColumns;
                $.each(columns, function (index, col) {
                    grid.hideColumn(col.field);
                });
            }
        }
    })
        .find(".k-i-filter")
        .removeClass("k-i-filter")
        .addClass("k-i-columns");
    $(`#${columnSelectorContainer}`).find(".k-grid-filter").attr("title", translateText("Select Columns", "Global"));
    $(`#${columnSelectorContainer}`).find(".k-grid-filter").attr("aria-label", translateText("Select Columns", "Global"));
    $(`#${columnSelectorContainer}`).find(".k-grid-filter").addClass("btn btn-link k-state-active");
    $(`#${columnSelectorContainer}`).find(".k-grid-filter").append(translateText("Select Columns", "Global"));

    function grid_columnHide(e) {
        let datasource = e.sender.dataSource;
        let column = e.column.field;
        let filter = datasource.filter();
        let index = null;
        if (filter && filter.filters) {
            index = findObjectIndexByProperty(filter.filters, "field", column);
        }
        if (index !== null) {
            datasource.filter([]);
            $(".k-grid-search input").val("");
        }
    }

    grid.bind("columnHide", grid_columnHide);
}

Martin
Telerik team
 answered on 27 Jun 2024
1 answer
97 views

Good afternoon,

I'm trying to integrate the FileManager component into an Oracle APEX application. I created a REST web service that generates the following JSON:

[
  {
    "name": "General",
    "isDirectory": true,
    "hasDirectories": true,
    "path": "folder",
    "extension": " ",
    "size": 90,
    "createdUtc": "/Date(1718637638946)/",
    "items": [
      {
        "name": "Test Folder 2",
        "isDirectory": true,
        "hasDirectories": false,
        "path": "folder/Test Folder 2",
        "extension": " ",
        "size": 8820,
        "createdUtc": "2024-06-18T20:56:13Z"
      },
      {
        "name": "TestFolder1",
        "isDirectory": true,
        "hasDirectories": false,
        "path": "folder/TestFolder1",
        "extension": " ",
        "size": 0,
        "createdUtc": "2024-06-07T19:52:48Z"
      },
      {
        "name": "File1.pdf",
        "isDirectory": false,
        "hasDirectories": false,
        "path": "folder/File1.pdf",
        "extension": ".pdf",
        "size": 689541,
        "createdUtc": "2024-06-07T19:52:37Z"
      },
      {
        "name": "File2.pdf",
        "isDirectory": false,
        "hasDirectories": false,
        "path": "folder/File2.pdf",
        "extension": ".pdf",
        "size": 312498,
        "createdUtc": "2024-06-07T19:52:37Z"
      },
      {
        "name": "File3.xlsx",
        "isDirectory": false,
        "hasDirectories": false,
        "path": "folder/File3.xlsx",
        "extension": ".xlsx",
        "size": 107150,
        "createdUtc": "2024-06-07T19:52:38Z"
      },
      {
        "name": "File4.msg",
        "isDirectory": false,
        "hasDirectories": false,
        "path": "folder/File4.msg",
        "extension": ".msg",
        "size": 376832,
        "createdUtc": "2024-06-07T19:52:37Z"
      }
    ]
  }
]

When the page loads, the component is rendered correctly (See the "General" folder in the following image):

However, when I click on the tree viewer (or double click on the folder in the right side) to view its contents, the result is a duplicated "General" folder. If I continue to select any of these folders, it keeps duplicating them:

In the network tab I see that when I selected the folder, two calls were made to the URL I defined in the dataSource.transport, this time adding some extra parameters (path/target and target):


This is the code to initialize the File Manager:

$("#filemanager").kendoFileManager({
    dataSource: {
        schema: kendo.data.schemas.filemanager,
        transport: {
            read: {
                url: "https://myservice/teams",
                method: "GET",
                dataType: "json"
            }
        }
    }
});

Could you please help me understand what am I missing or doing wrong?

As an additional question, I'd like to include in the JSON one more parameter (a download URL) that I'd like to use in the Context Menu, so when I right click on top of a file I select the option to download it. To accomplish this, do I need to modify completely the dataSource.schema? Or can I just simply add the URL to the JSON and then reference its value in the contextMenu.items array? Or (even better) does the File Manager has a built-in function to download files?

Thank you very much!

 

Martin
Telerik team
 answered on 26 Jun 2024
1 answer
127 views

I have followed all the examples but nothing is overriding the default theme.  I even tried to change it in after everything is loaded inside my done routine.

 

function createTreeView(dataURL,divName) {
    $.ajax({
        type: 'GET',
        url: dataURL,
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {},
        error: function (request, error) {
            console.log(error);
        }
    }).done(function(data) {
         ds = new kendo.data.HierarchicalDataSource({
            data: data,
            schema: {
                model: {
                    id: "taskid",
                    children: "items",
                    hasChildren: "haschildren"
                }
            }
        });    
        $("#"+divName).kendoTreeView({
            dataSource: ds,
            dataTextField: "taskname",
            dataUrlField: "linkto"
        });
        $('.k-treeview').css('background', 'lightblue');
    })// end done
}

 

 

Neli
Telerik team
 answered on 25 Jun 2024
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?