Telerik Forums
Kendo UI for jQuery Forum
1 answer
622 views

I get this error when trying to bind remote data from a .Net Core endpoint  to jQuery UI Grid.



Im hitting a .Net Core endpoint which returns a List<MyModel>

[HttpGet("/api/[controller]/[action]/{applicationId}/")]
public async Task<IActionResult> GetProducts(int applicationId)
{
    //return List<MyModel>
    var products = await this._mortgageApplicationService.GetMortgageApplicationProducts(applicationId);
    var json = JsonConvert.SerializeObject(products);
    return Ok(json);
}

 

In jQuery UI i have following javascript method which tries to display the json results.
Note I recreated the products json object locally and it worked as shown in the method below.
Why doesn't it work from the remote end point?

function getReportData() {
    var applicationId = $("#MortgageApplicationId").val();
    var url = "/api/MortgageStageProductsApi/GetProducts/" + applicationId;

    //This does NOT work
    $("#productGrid").kendoGrid({
        dataSource: {
            transport: {
                read: url,
                dataType: "json"
            },
            schema: {
                model: {
                    id: "Id",
                    fields: {
                        Id: { type: "number" },
                        ProductProvider: { type: "string" },
                        ProductTypeName: { type: "string" },
                        MortgageExpiry: { type: "string" }
                    }
                }
            },
            pageSize: 20,
            serverPaging: false,
            serverFiltering: false,
            serverSorting: false
        },
        filterable: true,
        sortable: true,
        pageable: false,
        columns: [{
            field: "Id",
            filterable: false
        }, {
            field: "ProductProvider",
            title: "Provider"
        }, {
            field: "ProductTypeName",
            title: "Product Type"
        }, {
            field: "MortgageExpiry",
            title: "Expiry"
        }
        ]
    });


    //This works using json object created using the same json returned
    var products = [
        {
            Id: 1,
            MortgageApplicationId: 2171,
            ProductProvider: "Ulster Bank",
            MortgageTermYears: 5,
            MortgageTermMonths: 10,
            MortgageRepaymentType: 1,
            ProductTypeId: 1,
            ProductTypeName: "Fixed",
            MortgageProductTermYears: 5,
            MortgageExpiry: "2025-01-21T00:00:00",
            MortgageLenderRate: null,
            MortgageAdviceFee: 120,
            ProductBrokerCommissionPercentage: 10,
            ProductBrokerCommissionFlatFee: null,
            DocumentsUploadedList: []
        },
        {
            Id: 2,
            MortgageApplicationId: 2171,
            ProductProvider: "Ulster Bank",
            MortgageTermYears: 5,
            MortgageTermMonths: 10,
            MortgageRepaymentType: 1,
            ProductTypeId: 1,
            ProductTypeName: "Fixed",
            MortgageProductTermYears: 5,
            MortgageExpiry: "2025-01-21T00:00:00",
            MortgageLenderRate: null,
            MortgageAdviceFee: 120,
            ProductBrokerCommissionPercentage: 10,
            ProductBrokerCommissionFlatFee: null,
            DocumentsUploadedList: []
        }
    ];

    $("#productGrid1").kendoGrid({
        dataSource: {
            data: products,
            schema: {
                model: {
                    id: "Id",
                    fields: {
                        Id: { type: "number" },
                        ProductProvider: { type: "string" },
                        ProductTypeName: { type: "string" },
                        MortgageExpiry: { type: "string" }
                    }
                }
            },
            pageSize: 20,
            serverPaging: false,
            serverFiltering: false,
            serverSorting: false
        },
        filterable: true,
        sortable: true,
        pageable: false,
        columns: [{
            field: "Id",
            filterable: false
        }, {
            field: "ProductProvider",
            title: "Provider"
        }, {
            field: "ProductTypeName",
            title: "Product Type"
        }, {
            field: "MortgageExpiry",
            title: "Expiry"
        }
        ]
    });
}

Brendan
Top achievements
Rank 1
Iron
 answered on 18 May 2023
1 answer
202 views

I am running the current version, 2023.1.425.

The control is actually first created through asp.net core MVC, however I'm using the CustomCommand method as such. Please note the window is already initialized prior to this. Upon the first use of my custom "Tags" context menu, the window opens and I'm able to carry out operations as expected. After closing the window, and attempting to open it again, I get an error in the browser console.

var filemanagerNS = kendo.ui.filemanager;
        filemanagerNS.commands.MyCustomCommand = filemanagerNS.FileManagerCommand.extend({
          exec: function(){
                 var FileIDs = Array();
                 var i = $('#filemanager').getKendoFileManager().getSelected();
                 $(i).each(function(){
                     if (!this.isDirectory)
                        FileIDs.push(this.ID);
                 });

                if (FileIDs.length > 0) {
                    // we'd call up our modal here populated with some kind of tag manager
                    $.post( "/Tags", { "FileIDs": FileIDs }, function( data ) {
                        $("#frmmodal").html(data).data("kendoWindow").open();
                    });
                 }
          }
        });


This works the first time, but attempting to open the window again results in the following error:

Uncaught TypeError: n.filemanager.commands[t] is not a constructor
    at init.executeCommand (kendo.all.js:318819:21)
    at init.trigger (kendo.all.js:318819:21)
    at init.action (kendo.all.js:318819:21)
    at init._onSelect (kendo.all.js:318819:21)
    at init.trigger (kendo.all.js:318819:21)
    at init._triggerEvent (kendo.all.js:318819:21)
    at init._triggerSelect (kendo.all.js:318819:21)
    at init._click (kendo.all.js:318819:21)
    at HTMLUListElement.dispatch (jquery.min.js:3:12445)
    at r.handle (jquery.min.js:3:9174)

 

As a result, the component stops functioning entirely, not just the context menu -> window method that seems to be causing this.

Martin
Telerik team
 answered on 17 May 2023
0 answers
130 views

TLDR: Never mind, user error

It seems that whether I specify labels: { visible: 'false' } or labels: { visible: 'true' }, the label is always displayed. I would have expected that specifying false would not cause the label to display. Specifying another option, such as labels: { format: '{0:C0}' }, does not cause the label to display.

Here is a dojo demonstrating the issue. Note that both the second and third bars display labels, even though the second bar has visible set to false. The first bar, specifying a format for the label, does not have its labels displayed.

Jay
Top achievements
Rank 3
Bronze
Iron
Iron
 updated question on 16 May 2023
1 answer
116 views

Hi, we have a requirement to customise the month view of the scheduler. We are developing a system for users to log their on-call hours and overtime. Our pay month starts on the 24th through to the 23rd of the following month. 

Is there a way customise the month view so that if Jan is selected it displays from Jan 24th through to Feb 23rd... if Feb is selected it displays from Feb 24th to March 23rd etc.

When viewing a month any dates outside the range should be disabled so for example if viewing May 2023 where May 24th is a Wednesday and the week begins on Mondays then May 22nd and 23rd would be disabled and as Jun 23rd is a Friday June 24th and 25th would be disabled.

Many thanks

Attached are examples I was able to do using FullCalendar JS by AR Shaw but I would prefer to use Kendo.

Nikolay
Telerik team
 answered on 16 May 2023
1 answer
186 views

Hello,

How do change the header color, for each cards like the picture,

 

Thanks

Christophe

Nikolay
Telerik team
 answered on 15 May 2023
1 answer
169 views

Hi,

We are looking into ways on how we can globally Html Sanitize/Purify anything that is rendered on a Kendo Grid. We are looking into the following options:

1. Create a custom widget that extends the Kendo Grid

2. Globally tap into databinding event

It would be awesome if the second option is possible.

Nikolay
Telerik team
 answered on 15 May 2023
1 answer
135 views
I am in the process of upgrading an old application that is using Kendo 2016.1.112 and I tried to upgrade to the latest but having some CSS issues. This application is also using Bootstrap 2.3.2, so I am curious if it is compatible at all before digging too deep into the issue. 
Nikolay
Telerik team
 answered on 15 May 2023
2 answers
616 views
Hello,
I use Kendo UI Angular,
I have a kendomulticombobox in a form, I use this combobox in several forms, and to avoid copying and pasting, I thought of setting up a separate component for that, and just call it each time I need.
It's to say that the form has a formgroup, and that this formgroup has several formcontrols, that I get when I submit the form.
So when I integrate my custom component, I get an error `ERROR Error: No value accessor for form control with name:` and yet it's the same formcontrol that I use before.

Has anyone experienced this kind of problem? Or do you have any solutions please? Thanks

Henintsoa
Top achievements
Rank 1
Iron
 updated answer on 15 May 2023
1 answer
868 views

I have a grid where the rows are selectable and I need a way to add a new row above the selected row.

Is there an example on how to achieve this?

Neli
Telerik team
 answered on 15 May 2023
1 answer
155 views

Hello,

Please see the following example: https://dojo.telerik.com/UsIQijOG/10

Reproduction steps:

  1. Open the console.
  2. Run the program
  3. Press the button.
  4. Enter "Test" into the Name field.
  5. Press submit.
  6. The name field in the console is empty.

Expected:

  1. The name field in the console is databound to the textbox in the window.
  2. The name field should be populated with the value entered into the name textbox.

 

Thanks,

Graham

Georgi Denchev
Telerik team
 answered on 12 May 2023
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Dialog
Chat
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?