Telerik Forums
Kendo UI for jQuery Forum
3 answers
688 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
198 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
1 answer
657 views
I have configured a Kendo ComboBox as follows:

    var junk = $("#junk").kendoComboBox({
        dataTextField: "Code",
        dataValueField: "Id",
        dataSource: {
            type: "json",
            //serverFiltering: true,
            transport: {
                read: {
                    url: "myServlet?action=ReadJunk",
                    contentType: "application/json;charset=utf-8",
                    dataType: "json"
                }
            },
            schema: {
                model: {
                    id: "Id",
                    fields: {
                        Id: {
                            type: "integer"
                        },
                        Code: {
                            type: "string"
                        },
                        shortDescription: {
                            type: "string"
                        }
                    }
                }
            }
        },
        change: function(e){
            // in here I want to set the ShortDesc widget's content to the selected shortDescription
            $("#ShortDesc").value = "shortDescription";  // this doesn't work
        }
    }).data("kendoComboBox");



The values ID, Code, and shortDescription are properly being returned by my Java Servlet. In the change event I would like set the value of another control to the value of shortDescription that is associated with the selected ComboBox item. What is the proper format for accessing this value?

Thanks

Steven
Georgi Krustev
Telerik team
 answered on 07 Oct 2014
3 answers
126 views
I am trying to bind to a list view, but with no luck, I have checked with fiddler that data contains an array and is populated correctly.
Where am I going wrong thanks

var vm = kendo.observable({ jobs: data });
kendo.bind($("#jobs-list"), vm);



<ul id="job-ul" data-role="listview" data-style="inset" data-type="group" data-template="jobs-list-template" data-bind="source: jobs"></ul>
 
<script type="text/x-kendo-template" id="jobs-list-template">
    <li class="row job-list-item" data-bind="attr: {'data-job-id': JobId}">
        <h3><span data-bind="text: Property"></span> <span data-bind="text: LocationName"></span></h3>
    </li>
</script>
Alan Mosley
Top achievements
Rank 1
 answered on 07 Oct 2014
8 answers
1.7K+ views
I had been getting random errors when navigating through my app. After digging down into the issue if found the cause.

When elements are removed from the down the scope must be destroyed. Angular Kendo listens to the $destroy event and responds by  removing any remaining event handlers as to minimize memory leaks.

Starting at this this method:
```
// Cleanup after ourselves
scope.$on( '$destroy', 
   widget.destroy();
});
```

I only have the minified version of kendo.all.js, but the destroy method goes a little like

```
destroy: function() {
this.wrapper.off(y).find("*").off(y);
this._popup && (this._selector.destroy(), this._popup.destroy());
this._selector = this._popup = this.wrapper = null;
h.fn.destroy.call(this)
}
```


The issue for me is the wrapper property is null by the time destroy is invoked. My guess is Angular and  JQuery removes this element before kendo has the chance to do so.





Alex Gyoshev
Telerik team
 answered on 07 Oct 2014
3 answers
112 views
When I'm using appendTo if i try to remove the widget instance to show just one notification at the same time the wrapper element is also removed.

example ('Static in the right panel', then 'Hide all notifications'): http://dojo.telerik.com/alOyo

Dimo
Telerik team
 answered on 07 Oct 2014
1 answer
125 views
Hello,

I have realized that when we move an all-day-event the scheduler preserves the start time (changing only the hour) but when resizing it resets the time to 00h00m.
Would it be possible to keep the selected time and only change the date? 

Thank you very much in advance for your help.

Vladimir Iliev
Telerik team
 answered on 07 Oct 2014
1 answer
585 views
Hello,

  My requirement has to show ellipsis in Grid if text is long and when user click or mouse over the ellipsis the full text should come up as bubble or popup window.
This page is show the history of data. there this column has both new value and old value. mock up of the design is attached. 

1st Attached before clicking to ellipsis and 2nd after clicking to ellipsis
Dimo
Telerik team
 answered on 06 Oct 2014
5 answers
142 views
Hello everybody. 

I have a kendo chart on MVC which is showing some information with a date axis for a year. The maximum number of points allowed is 365 (one for each day of the year). 
The default display setting is set to a "complete year view" with just 12 points (each one for each month of the day). However, I have implemented a drill in custom function where on the series click the chart displays the 31 points related to the clicked month.  

However, my chart does not always have the full information so I might not have 365 points to show. Therefore, I am using ChartLineStyle.Smooth, to join the existing points. On the full year view, The points join smoothly just as I want. However, when I drill in the data for the month appears to be isolated from the subsequent points in the series (there is no smooth line connecting to the next point). Is there a way to connect the different data points with a smooth line even though they are not being shown?

 I have a attached a couple of files to  show you what I currently have vs what I want.

Greetings,
Luis.

Hristo Germanov
Telerik team
 answered on 06 Oct 2014
7 answers
2.7K+ views
Hello!

I built a custom theme in ThemeBuilder for Kendo UI based on Bootstrap theme.  Now I have the colors that I want, except for a couple of places.  For example Calendar and DatePicker Selected Date has a dark gradient in the background.  How do I get rid of it?

I read a proposed solution here: http://stackoverflow.com/questions/13507971/kendo-ui-picker-css-issue, but it doesn't seem to work for me.

Please help me address this!

Thank you!

Sergey
Sergey
Top achievements
Rank 1
 answered on 06 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
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?