Multi-column headers error showing foreign key column

1 Answer 133 Views
ComboBox Grid
Mr Chuc
Top achievements
Rank 2
Iron
Iron
Mr Chuc asked on 27 Oct 2022, 04:48 AM | edited on 27 Oct 2022, 06:49 AM

Hi,

I have a data display problem, multi-column header error showing foreign key column as shown in attached video.

Can someone help me, many thanks.
The foreign key column property is declared as below:

        col.dataTextField = col.dataTextField ?? "text";
        col.dataValueField = col.dataValueField ?? "value";
        col.dataSource = {
            type: "json",
            transport: {
                read: function (options) {
                    ufn_ApiGetLookup({
                        data: col.source,
                        success: function (d) {
                            options.success(ufn_GetData(d));
                        }
                    });
                }
            }
        }

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 31 Oct 2022, 11:55 AM

Hello,

Thank you for the provided recording and code snippet.

It appears that this a bug on our end, you can track the following issue for progress:

https://github.com/telerik/kendo-ui-core/issues/6782 

As for a workaround, you can use the following override of the internal logic until a fix is deployed:

// Add the following snippets before the Grid initialization.
        function leafColumns(columns) {
          var result = [];

          for (var idx = 0; idx < columns.length; idx++) {
            if (!columns[idx].columns) {
              result.push(columns[idx]);
              continue;
            }
            result = result.concat(leafColumns(columns[idx].columns));
          }

          return result;
        }

        kendo.ui.Grid.fn._foreignKeyBindings = function(columns) {
          var that = this;
          columns = leafColumns(columns);
          var length = columns.length;
          var column;

          for (var i = 0; i < length; i++) {
            column = columns[i];

            if (column.dataSource) {
              that._fetchForeignKeyValues(column);
            }
          }
        }

// initialize the widget
$("#grid").kendoGrid();

Dojo

https://dojo.telerik.com/@gdenchev/ErATOXuV 

I apologize about the caused inconvenience.

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Mr Chuc
Top achievements
Rank 2
Iron
Iron
commented on 18 Nov 2022, 02:23 AM

Thanks for your reply, I used it and solved problem.
Tags
ComboBox Grid
Asked by
Mr Chuc
Top achievements
Rank 2
Iron
Iron
Answers by
Georgi Denchev
Telerik team
Share this question
or