Telerik Forums
Kendo UI for jQuery Forum
1 answer
225 views
We are in the very start of a Web API using the new OData v4 specification.
Still, I'm not sure about how Kendo can handle v4 OData.

So far, test following the example in http://demos.telerik.com/kendo-ui/grid/remote-data-binding, and I have been asked if there have been support to OData v4 at all.

The closest we got required some work around like this:

$(document).ready(function () {
            dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "http://localhost/SAC.OData/Municipio",
                        dataType: "json",
                        type: "GET",
                        beforeSend: function (req) {
                            req.setRequestHeader('Accept', "application/json;odata.metadata=none");
                        }
                    }
                },
                schema: {
                    data: "value",
                    model: {
                        id: "Id"
                    }
                },
                pageSize: 20,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            });

            $("#grid").kendoGrid({
                dataSource: dataSource,
                filterable: true,
                sortable: true,
                pageable: true,
                columns: [
                    { field: "Id" },
                    { field: "Nome" }]
            });
        });


I need to know if there is support for OData v4 specification, or wel'll have to fallback to the v3.

Best regards
Daniel
Telerik team
 answered on 08 Oct 2014
1 answer
162 views
Hi, 
I have a problem regarding the columnShow and columnHide events. Basically, if I will call grid.setDataSource(dataSource) before the _init() method of the Menu class is called, the two events are not issued anymore. Just uncomment the indicated line (24.) in the code sample and watch the browser console: the columnHide event does not get called anymore. The same goes for the columnShow event.

Resolution: In the destroy method of the Menu class, instead of

1.if (that.options.columns && that.owner) {
2.    that.owner.unbind("columnShow", that._updateColumnsMenuHandler);
3.    that.owner.unbind("columnHide", that._updateColumnsMenuHandler);
4.}

change to
1.if (that.options.columns && that.owner && that._updateColumnsMenuHandler) {
2.    that.owner.unbind("columnShow", that._updateColumnsMenuHandler);
3.    that.owner.unbind("columnHide", that._updateColumnsMenuHandler);
4.}

The idea is that the _updateColumnsMenuHandler is undefined at the call time, and all the configured event handlers get unbound.
Could you please provide me a time frame when this fix will be delivered and in which release?

Thanks,
Ioan

Code sample:
01.$("#grid").kendoGrid({
02.  columns: [
03.    { field: "name" },
04.    { field: "age" }
05.  ],
06.  dataSource: [
07.      { name: "Jane Doe", age: 30 }
08.  ],
09.  columnMenu: true,
10.  columnHide: function(e) {
11.    console.log("HIDE " + e.column.field); // displays the field of the hidden column
12.  },
13.  columnShow: function(e) {
14.    console.log("SHOW " + e.column.field); // displays the field of the column made visible
15.  }
16.});
17.var dataSource = new kendo.data.DataSource({
18.  data: [
19.    { name: "John Doe", age: 33 }
20.  ]
21.});
22.var grid = $("#grid").data("kendoGrid");
23.// uncomment the next line
24.//grid.setDataSource(dataSource);
Rosen
Telerik team
 answered on 08 Oct 2014
1 answer
1.8K+ views
Hi,

As per our requirement we need to show the component border to red when the component validation fails. Right now when the validation fails kendo is adding a span to the component. I don't need that message or a tool tip. I need to make all the fields which are invalid with red border and make the first error field focusable.
Georgi Krustev
Telerik team
 answered on 08 Oct 2014
1 answer
147 views
I'm trying to render out a TabStrip widget in a Window widget via MVVM but I am not able to get it to work.

Here is my template:
<script id="myTemplate" type="text/x-kendo-template">
    <div data-role="tabstrap">
        <ul>
            <li class="k-state-active">Tab 1</li>
            <li>Tab 2</li>
            <li>Tab 3</li>
        </ul>
 
        <div>
            <p>tab 1</p>
        </div>
 
        <div>
            <p>tab 2</p>
        </div>
 
        <div>
            <p>tab 3</p>
        </div>
    </div>
</script>

Here is my code:
var viewModel = kendo.observable({});
var template = kendo.template($("#myTemplate").html().trim(), { useWithBlock: false });
var $dialog = $(template());
 
kendo.bind($dialog, viewModel);
 
$dialog.kendoWindow({
    title: "My Dialog",
    width: 600,
    height: 300
});
 
$dialog.data("kendoWindow").open();

The dialog opens fine however the TabStrip widget is not rendered.  Here's a link to an example of the issue.
http://example.rengr.co/home/tabstripWindow

I tried modifying one of the demos to do the same and for some strange reason it works fine, although for some reason it opens another additional empty window underneath.  Here's a link to that example.
http://dojo.telerik.com/eFAL

RES
Top achievements
Rank 1
 answered on 08 Oct 2014
2 answers
313 views
Hi,

 We have 2 ListView controls. When user clicks on one ListView, we want to clear any selection on the other list. So we called clearSelection() on the other ListView's change event, for both the ListView controls. But its giving error as 'apply' already in progress - we are using Angular version of the controls.

 Please let me know how we can fix this.

Thanks a lot.
Abhishek
Top achievements
Rank 1
 answered on 07 Oct 2014
1 answer
116 views
Dragging an event into the all day row on the top of the scheduler makes the event disappear. 


How to recreate the error:
1. Go to the kendo demo site http://demos.telerik.com/kendo-ui/scheduler/index.
2. Create and save an event
3. Drag the event to the "all day" section and watch it disappear.


Is this a bug or intentional?

Thanks,
Zohar
Kiril Nikolov
Telerik team
 answered on 07 Oct 2014
1 answer
130 views
I am VERY new to all of this so I ask that you please bear with me.  I am using the Grid and have the editable.mode set to "popup".  I have changed the backend Java Servlet to have an SQL error on purpose to figure out how to do error handling.

In the client javascript for Kendo Grid I have the following which I basically cut and pasted from an example.

schema: {

                errors: "error",

                error : function(e) {
                    alert(e.errors);
                },

I have no idea what I need to do in the servlet in order to send an appropriate error to the client code such that it will be caught.  I tried this but it isn't working:
response.sendError(422, "error: " + exception.getMessage());




Petur Subev
Telerik team
 answered on 07 Oct 2014
1 answer
125 views
Hi, I have a custom tool that adds an html element inside the editor's body at the cursor position.
This works great but I wish this element to be unique so that if a user clicks the tool again, it deletes the existing element and then add it again at selection (Cursor position).

My problem is that editing the editor's value also resets the selection.
I tried saving the selection and range into a temporary variable and re-assign them or to copy the editor's selectionRestorePoint but to no avail.

Is there a way to edit the editor's content and also keep the cursor position ?

Thanks
Andre Beauchamp
Top achievements
Rank 1
 answered on 07 Oct 2014
3 answers
664 views
Hi Folks,

I have been struffling with the following issue...
I want to achive that a row when it is selected is scrolled to the top of the table.
The table is configured with virtual scolling and the datasource is bound to an odata service with server side paging

My code is working fine as long as the first page of data is shown. When I scroll the table, the row scrolls out of the view.

I would be glad if anyone can help me to find the correct way to calculate the correct scroll amount.

---
var selected = t.mainGrid.select();
 if (selected.length == 0) return;

 var vs = t.mainGrid.wrapper.find('.k-grid-content').data('kendoVirtualScrollable');

 var scrollGridContentOffset = t.mainGrid.wrapper.find('.k-grid-content').offset().top;
 var selectContentOffset = t.mainGrid.select().offset().top;
 var distance = selectContentOffset - scrollGridContentOffset;
 var scrollTop = vs.verticalScrollbar.scrollTop();
 
 vs.verticalScrollbar.animate({ scrollTop: distance + scrollTop }, 250);

--- grid config

t.mainGrid = $('#hist_flights').kendoGrid({
                selectable: "row",
                change: t.mainGridOnChange,
                navigatable: true,
                dataSource: {
                    type: "odata",
                    transport: {
                        read: {
                            url: "https://someurl.com/fis/odata/mydata",
                            dataType: "json"
                        }
                    },
                    schema: {
                        data: function(data) {
                            return data.value;
                        },
                        total: function(data) {
                            return data["odata.count"];
                        },
                        errors: function(data) {
                        },
                        model: {
                            fields: {
                                Id: { type: 'number', nullable: false },
                                Carrier: { type: 'string' },
                                FlightNo: { type: 'string' },
                                OperationalSuffix: { type: 'string' },
                                CallSign: { type: 'string' },
                                DateOfOriginUTC: { type: 'date', nullable: false },
                                DateOfOriginLCL: { type: 'date' },
                                DateOfOperationUTC: { type: 'date' },
                                DateOfOperationLCL: { type: 'date' },
                                DepartureIATA: { type: 'string' },
                                DepartureICAO: { type: 'string' },
                                DestinationIATA: { type: 'string' },
                                DestinationICAO: { type: 'string' },
                                AcReg: { type: 'string' },
                                FlightDuplicationNo: { type: 'number' },
                                BriefingSequenceNo: { type: 'number' },
                                BriefingComplete: { type: 'boolean' },
                                Withdrawn: { type: 'boolean' },
                                State: { type: 'string' },
                                StateChanged: { type: 'date' },
                                OFPState: { type: 'string' }
                            }
                        }
                    },
                    pageSize: 200,
                    serverPaging: true,
                    serverFiltering: true,
                    serverSorting: true
                },
                groupable: true,
                sortable: {
                    mode: "multiple",
                    allowUnsort: true
                },
                detailTemplate: kendo.template($("#detail_template").html()),
                reorderable: true,
                resizable: true,
                columnMenu: true,
                batch: true,
                height: contentHeight,
                scrollable: {
                    virtual: true
                },
                filterable: {
                    mode: "row,menu"
                },
                detailInit: t.detailInit,
                columns: [...]
            }).data('kendoGrid');
Kiril Nikolov
Telerik team
 answered on 07 Oct 2014
1 answer
194 views
Let's say I have a DataSource of products. By default, we display the products in a list form, and that template is called "list-template". 

<tbody data-template="list-template" data-bind="source: products"></tbody>

What if we want to allow the user to see the same products but in grid form (e.g. "grid-template")? Can we change the data-template after the fact to do this?
Petyo
Telerik team
 answered on 07 Oct 2014
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?