Telerik Forums
Kendo UI for jQuery Forum
3 answers
3.2K+ views

Hi there,

I have a dropdownlist control which list all records fetched from a remote data source.   The code below shows the  creation of data source, fetch data and, populates the dropdownlist with records.

getSchedules(): void {
            const schedulesData = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "/.../Schedules?entityName=someEntity",
                        cache: false,
                        dataType: "json",
                        contentType: "application/json",
                        type: "GET",
                        headers: window["authenticationBearerToken"]
                    }
                },
                autoSync: true,
                serverFiltering: true,
                error: (e: kendo.data.DataSourceErrorEvent) => {
                    console.log(e);
                }
            });
            schedulesData.fetch().then(() => {
                const schedules = schedulesData.data()[0];
                if (schedules !== undefined && schedules !== null) {
                    // Bind dropdown list to list of schedules
                    $("#schedules").kendoDropDownList({
                        optionLabel: "Choose available schedule",
                        dataTextField: "Name",
                        dataValueField: "ScheduleId",
                        dataSource: schedulesData.data(),
                        autoBind: false,
                        index: 0
                    });
                }
                else {
                    $("#schedules").kendoDropDownList({
                        optionLabel: "No available schedule",
                        dataTextField: "Name",
                        dataValueField: "ScheduleId",
                        dataSource: null,
                        autoBind: false,
                        index: 0
                    });
                }
            }).fail((error) => {
                console.log(error);
            });

 

As such, when a user creates a new schedule, the dropdownlist control should append the newly added schedule without doing a page refresh.  The problem is that, after creating a new schedule, dropdownlist datasource read method didn't work at all.  Code below for posting new schedule

const scheduleCreate: () => void = (): void => {
                        $.ajax({
                            type: "POST",
                            url: baseUrl + `AddSchedule?scheduleData=${scheduleData}`,
                            contentType: "application/json",
                            dataType: "json",
                            cache: false,
                            beforeSend: () => { }
                        }).done((result: any) => {
                            console.log(result);
 
                            window["UserDialog"](result.message, "OK", undefined);
                            isSuccess = result.isSuccess;
 
                            if (result.isSuccess) {
                                // refresh schedule's dropdown list
                                const schedulesDropdownList = $("#schedules").data("kendoDropDownList");
 
                                schedulesDropdownList.dataSource.read();
                                schedulesDropdownList.refresh();
                             }
                        }).fail((error: any) => {
                            console.log(error);
                        });
                    };

 

I tried several examples in Kendo UI dropdownlist API documentation, but no luck at all.  I also searched in telerik forums but couldn't find any related issues.

What seems go wrong in my dropdownlist configuration? or is there lacking in the datasource config?

Please help.

 

 

 

 

 

 

Joana
Telerik team
 answered on 25 Jan 2019
9 answers
9.9K+ views
Hi, 

How can I align, center and define the width of a grid cell

Thanks in advance
Ed
Top achievements
Rank 1
 answered on 25 Jan 2019
1 answer
596 views

Hello support,

With me updating to Kendo.Mvc.dll 2018.3.1219.545 I'm getting som Code CS1702 warnings (see screenshot) when using kendo widgets tag helpers (i.e. @(Html.Kendo().DropDownListFor or Html.Kendo().DatePickerFor).

I have System.Web.Mvc version 5.2.7.0 referenced in the asp.net mvc 5 project and in my root web.config I have this entry in my <runtime> section:

    <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
      </dependentAssembly>

I'm not sure how to fix these warnings. Can you help?

Thanks in advance

Best regards

Morten

Dimitar
Telerik team
 answered on 25 Jan 2019
4 answers
116 views

Hello

 

After upgrading from jQuery 3.1.1 to 3.3.1 we have an issue with last row in frozen area

Height of frozen area is smaller than height of horizontally scrollable area (see image in attachment)

Also see Dojo https://dojo.telerik.com/ODISarEn

 

Thank you

Viktor Tachev
Telerik team
 answered on 25 Jan 2019
2 answers
396 views

Dear Telerik,

 

I have a problem with the 'Add New Record'-Functionality.
When my Webservice is returning an empty array I cannot add a new record with the 'Add New Record'-button.
The empty row appears for a brief period of time(less than 1 second) and disappears again.

The Problem does not occur when get a filled array from the webservice.

Can you please help me ?

 

Henri

Tsvetina
Telerik team
 answered on 25 Jan 2019
7 answers
3.8K+ views

Hi All,

My grid displayed all data except for one column and it's showing as [object object] and I can't figured out where the problem is.  Below is my code

results return from JSON

...

var data = { data: gridData, total: gridData.length };
options.success(data);

 var data = { data: kendoViewModel.BatchGridData, total: kendoViewModel.BatchGridData.length };
                            options.success(data);

 }

            },
            serverPaging: true,
            pageSize: 20,
            schema: {                
                data: "data",
                total: "total",
                model: {
                    fields: {
                         ReportList: { type: "object", editable: true },                                    
                    }
                }
...

...

columns: [
    {
        width: 50,
        headerTemplate: '<input type="checkbox" id="checkAll" />',
        template: '<input type="checkbox" class="checkbox" />'
    },   
    {
        field: 'ReportList.Description',
        title: 'In Reports',
        width: 135,
        template: '#=ReportList#',      //[object object]
        editor: function invoiceReportsDropDown(container, options) {
            if (options.model.ReportList.length <= 1)
                return;
            $('<input data-text-field="Description" data-value-field="Id" data-bind="value:' + options.field + '"/>')
                  .appendTo(container)
                  .kendoDropDownList({
                      dataSource: options.model.ReportList,
                      dataTextField: "Description",
                      dataValueField: "Id",
                  });
        }

 

if I replace  template: '#=ReportList.Description#',  I get undefined.  Any help is appreciated.

 

TIA

Developer
Top achievements
Rank 1
 answered on 23 Jan 2019
1 answer
341 views

Hello,

Our designers asked us to us a pie chart which looks like https://bootsnipp.com/snippets/z8dD9 

We reviewed the documentation of https://demos.telerik.com/kendo-ui/donut-charts/donut-labels but we are not sure how to customize Kendo’s pie chart to match the requested design and especially the animation.

Can you please advise?

Thanks,

Ron.

Tsvetina
Telerik team
 answered on 23 Jan 2019
10 answers
864 views
Is it possible to have a line change from solid to dashed at some point, similar to the attached image? We'd like to do this to indicate the values transition from known to estimated values.
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 23 Jan 2019
5 answers
495 views

Hi,

After pacing the web and lots of forums, I still can not read a JSON file locally.

Can anyone help me ?

Here is my basic file for my tests, and my .json file on the right.

Forgive me if there are many mistakes. I start with Kendo UI

Thank you in advance for your precious help

Veselin Tsvetanov
Telerik team
 answered on 23 Jan 2019
1 answer
141 views

How can i set filterMenuInit in the grid with MVVM?

What is the name of property? data-menu-init?

Georgi
Telerik team
 answered on 22 Jan 2019
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
Drag and Drop
Map
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?