Telerik Forums
Kendo UI for jQuery Forum
19 answers
624 views

Hello,
            I have a function which constructs Observable ViewModel. In that there are 4-5 dataSource. 

function GetAirRequestMVVMTemplate() {
    debugger;
    //kendo.ui.progress($("body"), true);
    var airRequestViewModel = kendo.observable({
        FlightDestinationSource: function(e) {
            return new kendo.data.DataSource({
                transport: {
                    read: {
                        url: rootUrl("GetData/GetCountry"),
                        dataType: "json"
                    }
                },
                serverFiltering: true
            });
        },
        FlightOriginSource: function(e) {
            return new kendo.data.DataSource({
                transport: {
                    read: {
                        url: rootUrl("GetData/GetCountry"),
                        dataType: "json"
                    }
                },
                serverFiltering: true
            });
        },
        ViaSource: function (e) {
            debugger;
            var viadata = e.ArriveDepartDetails.via;
            return new kendo.data.DataSource({
                transport: {
                    read: {
                        url: rootUrl("GetData/GetCountry"),
                        dataType: "json",
                        data: function (e) {
                            return {
                                adddata: JSON.stringify(viadata) //viadata != null ? JSON.stringify(viadata) : JSON.stringify([])
                            };
                        }
                    }
                },
                serverFiltering: true
            });
        },
        AirlineIdsSource: function (e) {
            debugger;
            var airdata = e.AirlineIds;
            return new kendo.data.DataSource({
                transport: {
                    read: {
                        url: rootUrl("GetData/GetAirLines"),
                        dataType: "json",
                        data: function (e) {
                            return {
                                data: JSON.stringify(airdata)
                            };
                        }
                    }
                },
                serverFiltering: true
            });
        },
        ClassSource: function(e) {
         return new kendo.data.DataSource({
                transport: {
                    read: {
                        url: rootUrl("GetData/Get_Air_Class_Details"),
                        dataType: "json"
                    }
                }
            });
        },
        AllianceSource: function(e) {
            return new kendo.data.DataSource({
                transport: {
                    read: {
                        url: rootUrl("GetData/GetAlliance"),
                        dataType: "json"
                    }
                }
            });
        },
        TimeTypeSource: function(e) {
            return new kendo.data.DataSource({
                data: [
                    { Text: "None", Value: "-1" },
                    { Text: "Departs", Value: "D" },
                    { Text: "Arrives", Value: "A" }
                ]
            });
        },
        TimeTypeDataBound: function (e) {
            debugger;
            if (e.data.ArriveDepartDetails.TimeType == null) {
                e.data.ArriveDepartDetails.set("TimeType", "-1");
            }
        },
        OnOpenOriginAutoComplete: function(e) {
            debugger;
            var target = $(e.sender.element).data("kendoAutoComplete");
            target.list.width(280);
        },
        SaveAirRequest: function(e) {
            debugger;
            if ($("#APISForm").kendoValidator().data("kendoValidator").validate()) {
                if (validateAirRequestForm()) {
                    kendo.ui.progress($("#AirRequest"), true);
                    var data = {
                        airRequestData: e.data //AirRequestViewModel.AirItem.AirVMList
                    }
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        traditional: true,
                        data: JSON.stringify(data),
                        url: rootUrl("SearchAvailability/AirRequestMVVMSave"),
                        success: function(response) {
                            debugger;
                            if (response.Error == null) {
                                RefreshServiceElements();
                                $("#AirRequest").data("kendoWindow").close();
                            } else {
                                ShowKendoMessage("Error: " + response.Error);
                                AirRequestViewModel.AirItem.AirVMList.Error = null;
                            }
                            kendo.ui.progress($("#AirRequest"), false);
                        }
                    });
                }
            } else {
                ShowKendoMessage("Please Enter Required Fields");
            }
        },
        AddSegment: function(e) {
            debugger;
            // this.AirVMList.SegmentInfo.push(new this.AirVMList.SegmentInfo());
            //AirRequestViewModel.AirItem.AirVMList.SegmentSkeleton
            var object = JSON.stringify(AirRequestViewModel.AirItem.AirVMList.SegmentSkeleton);
            object = JSON.parse(object);
            AirRequestViewModel.AirItem.AirVMList.SegmentInfo.splice(parseInt(e.data.index + 1), 0, object);
            var prevDestination = AirRequestViewModel.AirItem.AirVMList.SegmentInfo[parseInt(e.data.index)].ArriveDepartDetails.Destination;
            AirRequestViewModel.AirItem.AirVMList.SegmentInfo[parseInt(e.data.index + 1)].ArriveDepartDetails
                .set("Origin", prevDestination);
            //AirRequestViewModel.AirItem.AirVMList.SegmentInfo.push(AirRequestViewModel.AirItem.AirVMList
            //    .SegmentSkeleton);
            for (var i = 0; i < AirRequestViewModel.AirItem.AirVMList.SegmentInfo.length; i++) {
                this.AirVMList.set("SegmentInfo[" + i + "].index", i);
            }
        },
        RemoveSegment: function (e) {
            debugger;
            AirRequestViewModel.AirItem.AirVMList.SegmentInfo.splice(e.data.index, 1);
            for (var i = 0; i < AirRequestViewModel.AirItem.AirVMList.SegmentInfo.length; i++) {
                this.AirVMList.set("SegmentInfo[" + i + "].index", i);
            }
        },
        ShowSegmentOptions: function (e) {
            debugger;
        },
        FlightOriginOnOpen: function (e) {
            debugger;
            //var target = $(e.sender.element).data("kendoDropDownList");
            //target.list.width(280);
        },
        ResetAirItem: function (e) {
            debugger;
            e.data.ArriveDepartDetails.set("Origin", null);
            e.data.ArriveDepartDetails.set("Destination", null);
            e.data.ArriveDepartDetails.set("DepartureDate", null);
            e.data.ArriveDepartDetails.set("TimeType", "-1");
            e.data.ArriveDepartDetails.set("DepartureTime", "00:00");
            e.data.ArriveDepartDetails.set("via", []);
            e.data.set("AirlineIds", []);
            e.data.set("ClassCodeId", null);
            e.data.set("FlightNumber", null);
            e.data.set("Alliance", null);
            e.data.set("Note", null);
        },
        HideSegmentOptions: function (e) {
            debugger;
            $(e.toElement).closest(".segmentdiv").find(".tobehidden").toggle();
            $(e.toElement).closest(".segmentdiv").find("#flipdown").toggle();
            $(e.toElement).closest(".segmentdiv").find("#flipup").toggle();
        },
        CancelAirRequest: function (e) {
            debugger;
            $("#AirRequest").data("kendoWindow").close();
        }
    });
    $.when(
            $.ajax({
                url: rootUrl("SearchAvailability/GetAirRequestJSONData"),
                type: "POST",
                dataType: "json",
                data: { requestId: $("#RequestID").val() }
            }),
            loadTemplate("Content/Templates/AirRequestViewModelNew.tmpl.htm")
        )
        .then(onAirRequestWindowSuccess(airRequestViewModel))
        .fail(onAirRequestWindowFailure);
}

 

All Datasource to etc. When select option any autocomplete or all other  send read/filter request to . I  know why its happening.  














Veselin Tsvetanov
Telerik team
 answered on 19 Dec 2017
1 answer
176 views

Hi People, I am using grids popup editor to edit the grid row. in that I am using custom editor (DropDown control) for some of field of Grid. Following is code for that Dropdown editor: 
function prontoStratumDropDownEditor(container, options) {
              $('<input required data-text-field="ABC" data-value-field="XYZ" name="' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                     dataSource: new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: "SomeURL",
                                type: "get",
                                datatype: "json",
                            }
                        }
                     }),
                     filter: "startswith",
                     suggest: true,
                     }
                });
        }

 

When I click on Edit Command of Grid, ideally dropdown should show me the name of already existing field For Eg: if grid row contain value "Animal" then when I click on Edit, by default DropDown should have "Animal" selected, but its not. I tried many things like getting rid of name property, remove required attribute etc but I do not know Why it is not showing me can anyone please help? 

Stefan
Telerik team
 answered on 18 Dec 2017
17 answers
1.1K+ views
In the basic usage example, the transport read url is set to msmdpump.dll.

I am investigating how to secure access to msdmpump.dll from the client, and I think that the only way is to introduce a server-side (Web Api) service as an intermediary between msmdpump.dll and the client application. Is that correct?

Assuming it is, could you provide some guidance on how to implement Web Api to do this? 

Thanks!
Gary
Alex Hajigeorgieva
Telerik team
 answered on 18 Dec 2017
3 answers
268 views

Hi guys, im having problem with these styles.i dont know what i could do anymore, any solution?

 

Stefan
Telerik team
 answered on 18 Dec 2017
6 answers
248 views
I'm using a PanelBar in the exact same manner as TreeView but the expected control is not being built.
Is this supported or am I trying to do something that is not supported? I'm on 2012 Q3

More info on my issue here
Veselin Tsvetanov
Telerik team
 answered on 18 Dec 2017
2 answers
351 views
TreeView datasource reloads when i try to expand a node, the parent data is appended to the expanded node. Strangely however if i collapse the expanded node and expand it again the child nodes are appended. Help please
Niranjan
Top achievements
Rank 1
 answered on 18 Dec 2017
8 answers
143 views

I have a request to create a widget that shows the next X upcoming events using MVC/C#. I figured the easiest way would be to create a ListView that pulls from the scheduler's datastore and take top X.

How can we tap into the logic of the scheduler to generate events from the event definitions/rules (e.g. handle recurrence rules, recurrence exceptions, timezones, etc)? I would think we can use the data from the schedulers datastore to generate events between now and an end date and take the next X upcoming.

If this is not possible, I assume we'd have to go down a more complex solution by using the scheduler with a custom view (like an agenda view) but I'd need to figure out how to show only the next X events and not all of them between two dates.

Veselin Tsvetanov
Telerik team
 answered on 15 Dec 2017
2 answers
520 views

Hey guys,
I'm trying to use the aggregation feature on the kendo grid control. But every time I got next error

"Uncaught ReferenceError: count is not defined error"

Here is the demo

https://dojo.telerik.com/imUVev

 

Alex Hajigeorgieva
Telerik team
 answered on 15 Dec 2017
3 answers
159 views

Please help since we have no longer confidence in kendo and we might use another library of components. 

The custom validation on a numeric field is not working after using setOptions. In the setOptions we are adding new numeric fields with custom validation between 0 and 100.

The below is a sample that I tried to implement to show our case:

https://dojo.telerik.com/egawE

 

Thank you in advance

Stefan
Telerik team
 answered on 15 Dec 2017
3 answers
102 views

Why doesn't re-binding a grid re-bind all of the filters that are associated with it?!

I have a grid that is populated with an MVC call that gets all the requests for a department or departments. The department drop-down is a multi-select drop-down and the grid is populated on a button click that gets all department IDs from the drop-down and runs the MVC call. The filter works exactly one time. The first time the button is clicked. If I change the department(s) in the drop-down and run the call again. The grid refreshes with the new data, but the filter on the "Funding" column (happens to be a multi-select filter) still shows the values from the first time the grid was loaded.

Stefan
Telerik team
 answered on 15 Dec 2017
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
ContextMenu
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
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?