Telerik Forums
Kendo UI for jQuery Forum
2 answers
258 views

I've been working on some error handling routines for in the event of a service failure, and have two questions as a result.

When the service fails, my error handler works as expected, and I'm able to get the error message from e.xhr.responseText. However, I have batch set to true in the Angular controller for the Gantt object, and the next time I make an update request, it's compounding the data with the failed request. I'd like to have control over whether to keep this data for the next request, or clear it on fail.

The other part of the issue is that when I hover over a Task, the information in the tooltip reflects the changed information that went out in the failed update, however, the view (position and size of the Task object) reflects the old data, so now I have an inconsistency between my model and my view. I tried to just call the refresh() method, but ran into the following problem:

var gantt = $("div[data-role='gantttimeline']"), // returns HTML element as expected
  ganttData = $("div [kendo-gantt]").data("kendoGantt"); // returns null, can't call refresh()

So, to recap, two issues. First of all, how can I clear the failed request from the queue and roll back the data in my model? Secondly, how can I get a handle on the Gantt data? All the examples that I could find use the above method, but they're also using Javascript to instantiate the object, where as I'm using Angular with a controller.

 Thanks in advance for your help!

 

 

Bozhidar
Telerik team
 answered on 31 Aug 2015
4 answers
342 views
I'm trying to modify the remote data schema to the local model in a datasource.  I'm using a parameterMap and its is working correctly for UPDATE, DESTROY, and CREATE methods... so i know its firing correctly.  However, on READ the data object is simply an empty object.   So I here i can't modify the remote data to conform to the local model.

I've found a workaround by using the requestEnd event of the data source... but I'd prefer to keep the logic withing the transport object which seems more appropriate.

John
Top achievements
Rank 2
 answered on 29 Aug 2015
2 answers
236 views

Hi,

I am trying to place a button in the pivot grid toolbar using some jQery selectors. It successfully places the button at the desired place while rendering the pivot grid. But after the pivot grid is completely rendered, the button disappears and I see no element in the DOM. ​Does kendo configuration removes any other element in the toolbar? Or am I missing? How can I achieve this?

Thanks,

Vinay.

Vinay
Top achievements
Rank 1
 answered on 29 Aug 2015
1 answer
88 views

dropdownlist didn't expand when touch on anywhere of dropdown.

dropdownlist only expand when click on arrow on the right of dropdown.

this happend on ios version 8.4.1 and previos version not happend like this

and below is my code

 <select id="searchType" style="width:100%;" data-role="dropdownlist" data-bind="value:selectedSearch,events:{change:onChangeSearch}">

                                <option value="upcoming">Upcoming</option>
                                <option value="selling">Selling Out</option>
                                <option value="today">Today</option>
                                <option value="custom">Custom</option>
                            </select>

Plamen Lazarov
Telerik team
 answered on 28 Aug 2015
8 answers
658 views

I am attempting to sum an Amount field on a kendo datasource, but the sum is always 0.

Datasource:
...
 return new kendo.data.DataSource({
        type: "odata",
        transport: {
            read: {
                url: serviceBaseUrl,
                dataType: "json"
            }
        },
        batch: false,
        serverPaging: true,
        serverSorting: true,
        serverFiltering: true,
        serverAggregates: true,
        aggregate: { field: "Amount", aggregate: "sum", type: "number" },
        schema: {
            data: function (data) { return data.value; },
            total: function (data) { return data["odata.count"]; },
            model: {
                id: "OrderID",
                fields: {
                    OrderID: { type: "int" },
                    MerchantID: { type: "int", required: true },
                    Amount: { type: "number", required: true },
                    PurchaseDate: { type: "date", defaultValue: new Date() }
                }
            }
        },
        error: function (e) {
            return (e.xhr.responseText);
            this.cancelChanges();
        },
        success: function (e) {
            alert('Success!');
        }
    });

Angular JS Controller:

 var dsYearOrders = new orderService(ngAuthSettings);
    $scope.thisyear = kendo.parseDate(moment().startOf('year').format('MM/DD/YYYY'));
    var yearfilters = SetFilter($scope.thisyear)
    dsYearOrders.filter(yearfilters);
    $scope.yearoforders = dsYearOrders; // -- this works, we see our chart data as intended
    $scope.sumYearSales = dsYearOrders.aggregates().Amount.sum;​​ // --Returns 0

 

I feel like I am missing something in the schema to return the proper aggregate amount, no?  Thanks in advance,

 Jayme

Jayme
Top achievements
Rank 1
 answered on 28 Aug 2015
3 answers
69 views

Has anyone encountered an intermittent JavaScript error "'undefined' is null or not an object" when using the Grid in IE8?

It occurs with KendoUI 2015.2.805 but not 2014.3.1316. The error occurs on line 55569 in kendo.all.js (non-minified) in KendoUI 2015.2.805 (in the leafDataCells method).

The error causes the grid to not be rendered correctly (paging bar appears just below column headings) when it occurs. It works fine every time in Chrome and Firefox.

When I say intermittent, I really mean it - I can sit there pressing F5 and it might happen once every 10 times.

I'm guessing it something to do with JavaScript loading or execution timing as the less JavaScript libraries and code I have on the page the more likely it is to work. This is making it extremely hard to diagnose, as more code I remove to try to narrow down the problem, the less frequently it occurs (for example I might have to refresh the page 20 times to get it to fail once).

Removing loading of other JavaScript libraries, removing KendoUI Grid configuration JavaScript, removing other JavaScript code on the page, using minified JavaScript libraries rather than "non-minified" libraries and loading JavaScript libraries from a CDN rather than local copy will all reduce the frequency at which the error occurs, but does not eliminate it.

This also makes it hard to put up a JSFiddle to demonstrate the problem, as it happens much more frequently when using a local server.

If anyone has any suggestions I would greatly appreciate it. I have been struggling with this bug for a while.

Vladimir Iliev
Telerik team
 answered on 28 Aug 2015
3 answers
101 views

I am trying to supply a TreeList widget with a list of TreeListModel objects that are based on  Model objects.  The way I am creating the TreeListModels is that I first create an empty kendo Model definition with no fields defined and then I create a TreeListModel definition with the empty base Model passed into the TreeList Model's define method as the first parameter, such that the TreeListModel inherits from the base Model.  I realize that this is not documented as being part of the public API, but for my application, we require such a setup because we proxy generate our TreeListModels, which extends (typescript) from a commonly shared Model definition.  I have created a simple example to demonstrate how the TreeList shows "loading" forever as soon as I try to do this model wrapping.  Please comment out the indicated parameter to see the breakage.

http://dojo.telerik.com/IdAhI 

 Any suggestions on workarounds/bug fixes, would be greatly appreciated. 

Thanks!
Michelle

T. Tsonev
Telerik team
 answered on 28 Aug 2015
1 answer
53 views
I am using the Kendo Grid for desktop and mobile. The "No Records To Display" message displays under the header of the grid when using mobile. I found this was because the _renderNoRecordsContent is looking to append the message on the parent element of the table. On mobile, the parent element is a scrollable container, not ".k-grid-content". Is there a reason we looking specifically for and appending the message on the closest ".k-grid-content"?
Dimo
Telerik team
 answered on 28 Aug 2015
5 answers
272 views

Hi !! I am trying to create a template for a SCHEDULE but my question is where i must put my event function if the object is not created in the init.

 Example ​object BUTTON BTN1

<div id="example">
    <div id="team-schedule">
    </div>
    <script id="event-template" type="text/x-kendo-template">
      <div>#:description #</div>
      # for (var i = 0; i < resources.length; i++) { #
        <div>
            #:resources[i].text #
        </div>
        # } #
    </script>
    <script id="customEditorTemplate" type="text/x-kendo-template">
    <button class="btn1" type="button">Foo</button>
   </script>
   <script>
</script>
<div id="scheduler"></div>
</div>    <script id="customEditorTemplate" type="text/x-kendo-template">
        <button class="btn1" type="button">Foo</button>
   </script>​

$("#scheduler").kendoScheduler({
    date: new Date("2013/6/13"),
    startTime: new Date("2013/6/13 08:00 AM"),
    endTime: new Date("2013/6/13 05:30 PM"),
    height: 1200,
        eventTemplate: $("#event-template").html(), //template event id
        views: [
        "workWeek",
        { type: "day",  minorTickCount: 4, selected: true },
        "week",
        "month",
        "agenda",
        { type: "timeline", eventHeight: 20}
        ],
        editable: {
            template: $("#customEditorTemplate").html(),
        },
        majorTick: 60,
        timezone: "Etc/UTC",
        dataSource: {
            batch: true,
            transport: {
                read: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks",
                    dataType: "jsonp"
                },
                update: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks/update",
                    dataType: "jsonp"
                },
                create: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks/create",
                    dataType: "jsonp"
                },
                destroy: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks/destroy",
                    dataType: "jsonp"
                },
                parameterMap: function(options, operation) {
                    if (operation !== "read" && options.models) {
                        return {models: kendo.stringify(options.models)};
                    }
                }
            },
            schema: {
                model: {
                    id: "taskId",
                    fields: {
                        taskId: { from: "TaskID", type: "number" },
                        title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                        start: { type: "date", from: "Start", interval:"15" },
                        end: { type: "date", from: "End", interval:"15" },
                        startTimezone: { from: "StartTimezone"},
                        endTimezone: { from: "EndTimezone" },
                        description: { from: "Description" },
                        recurrenceId: { from: "RecurrenceID" },
                        recurrenceRule: { from: "RecurrenceRule" },
                        recurrenceException: { from: "RecurrenceException" },
                        ownerId: { from: "OwnerID", defaultValue: 1 },
                        isAllDay: { type: "boolean", from: "IsAllDay" },
                        phone :{type:"text"},
                        ownerId: { from: "OwnerID", defaultValue: 1 },

                    }
                }
            },
        },
        group: {
            resources: ["Rooms"]
        },
        resources: [
        {
            field: "roomId",
            name: "Rooms",
            dataSource: [
            { text: "​test 1", value: 1},
            { text: "test 2", value: 2}
            ],
            title: "Room"
        }
        ]
        
    });​

Vladimir Iliev
Telerik team
 answered on 28 Aug 2015
1 answer
441 views

Dear Kendo UI Team,

 I'm using Kendo ui datetimepicker where I've set interval as 15.

As, interval is 15 if I open up time picker icon then it displays 12:00 AM, 12:15 AM ... 11:45 PM which is correct.

Now, my question is if I manually save time as 02:17 PM then while editing when I click on time picker icon I want automatically set time as 2:15 PM or 2:30 PM, how can I achieve this? If time is part of interval then it automatically selects but if not then in that case how can I make it possible?

Waiting for your answer, many thanks.

 

 

Ianko
Telerik team
 answered on 28 Aug 2015
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?