Telerik Forums
Kendo UI for jQuery Forum
3 answers
225 views
The following sample raises two issues which I struggle to sort out:

1) How to populate a HierarchicalDataSource and cast all items with a model derived from kendo.data.Node? In the following sample only nodes at the first level of the hierarchy (but none of the children) are cast; Accordingly calculated fields are undefined for all children.
2) How to display calculated fields in templates? In the following sample the function is actually printed in the resulting html by the template.

01.<!DOCTYPE html>
02.<html>
03.<head>
04.    <meta charset="utf-8">
05.    <title>Treeview</title>
08.    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
10.    <style>
11.        .img-24 {
12.            height: 24px;
13.            width: 24px;
14.        }
15.    </style>
16.</head>
17.<body>
18.<ul data-role="treeview" data-bind="source:sample" data-template="my-template"></ul>
19.<script id="my-template" type="text/x-kendo-template">
20.    <a href="#: item.hash$ #">
21.        <img src="#: item.icon$ #" alt="#: item.name #" class="img-24">
22.        <span>#: item.name #</span>
23.    </a>
24.</script>
25. 
26.<script>
27.    /**
28.     * Rummage model (displayed in treeview on find page)
29.     * @type {kendo.data.Model}
30.     */
31.    var STRING = 'string',
32.        NUMBER = 'number',
33.        MyNode = kendo.data.Node.define({
34.            id: 'id',
35.            hasChildren: true,
36.            children: {
37.                schema: {
38.                    data: 'items',
39.                    model: MyNode
40.                }
41.            },
42.            fields: {
43.                id: {
44.                    type: NUMBER,
45.                    editable: false
46.                },
47.                name: {
48.                    type: STRING,
49.                    editable: false
50.                },
51.                icon: {
52.                    type: STRING,
53.                    editable: false
54.                },
55.                hash: {
56.                    type: STRING,
57.                    editable: false
58.                }
59.            },
60.            icon$: function() {
61.                return 'http://localhost/images/' + this.get('icon');
62.            },
63.            hash$: function() {
64.                return 'http://localhost/find#!' + encodeURIComponent(this.get('hash'));
65.            }
66.        });
67. 
68. 
69.    window.viewModel = kendo.observable({
70.        sample: new kendo.data.HierarchicalDataSource({
71.            transport: {
72.                read: function(options) {
73.                    options.success([
74.                        { id: 1, name: 'node 1', icon: '1.png', hash:'1', items: [
75.                            { id: 4, name: 'node 1.1', icon: '1.1.png', hash:'1.1' },
76.                            { id: 5, name: 'node 1.2', icon: '1.2.png', hash:'1.2' }
77.                        ] },
78.                        { id: 2, name: 'node 2', icon: '2.png', hash:'2' },
79.                        { id: 3, name: 'node 3', icon: '3.png', hash:'3' }
80.                    ]);
81.                }
82.            },
83.            schema: {
84.                model: MyNode
85.            }
86.        })
87.    });
88. 
89.   $(document).ready(function() {
90.       kendo.bind('body', window.viewModel);
91.   });
92. 
93.</script>
94.</body>
95.</html>
Atanas Korchev
Telerik team
 answered on 02 Sep 2014
3 answers
173 views
There is a bug with the Kendo grid component. If a grid that has filterable mode "row" and you place the grid inside a Kendo window, the result will be buggy. When you try to change the column widths by resizing the column by dragging the columns wider with mouse, the wrapping window component will behave in an unexpeted way. The window will just suddenly collapse and go very small.

Is there any quick fix for this problem?.

The attached zip archive's index.html demonstrates the bug.
Kiril Nikolov
Telerik team
 answered on 02 Sep 2014
1 answer
176 views
I have an input element that I am using as a ComboBox, which works great:

<input id="imtSelect" name="IMT" required data-required-msg="IMT is required." data-bind="value: imt">

I have it configured down in the "function" part of the page I am working on:
var imtData = [ "US", "Canada", "Federal" ];
// create ComboBox for IMT...
$("#imtSelect").kendoComboBox({
    dataSource : imtData,
    index : 0
});

However, if I try to add the "placeholder" attribute to the combobox, it throws/breaks all formatting on the page.  The TabStrip, the other comboboxes, date pickers --- basically the styles/classes are no longer in effect.

Here is what I change it to:
$("#imtSelect").kendoComboBox({
    dataSource : imtData,
    index : 0
    placeholder : "Select..."
});

I have also tried to define this attribute in the input element itself (placeholder="Select..."), but it has no effect -- it does not appear in the combobox.

Not sure what I am doing incorrect.

Thanks!
Georgi Krustev
Telerik team
 answered on 02 Sep 2014
1 answer
210 views
I am using some css files in my kendo mobile application. But I am getting this error when I try to edit a div which contains this css. 

Error:
"Unable to edit 'file ../kendo.default.min.css'. The style sheet must be part of the current project and the project must be a web site or web application project."

Let me know what I am doing wrong.

Thanks.
Petyo
Telerik team
 answered on 02 Sep 2014
1 answer
134 views
Hi

I’m looking for a specific functionality in gantt chart control. For example: i have a record where <Summary> property has a "true" value and it’s a parent container for three particular child operations. By default this record that i've mentioned above is displaying as  a status progressbar (percent). But despite / instead of that i’d like to see additional blank spaces, it means a time periods where is a gap between start/end values.

Best regards

Lucas
Bozhidar
Telerik team
 answered on 02 Sep 2014
1 answer
146 views
Greetings, I have a question regarding the remote datasource with server paging. My attempts were not entirely successful so please shed some light on what I was doing wrong.
 
Basically I have a template that sets up the search result view that contains a listview as its content. The listview is set up via the template. I have a search button that creates the datasource that the listview reads from, and then navigate to the search result view.
 
On chrome it seems to be working ok but when I load it on a device with cordova, it throws an error saying 'undefined' is not an object evaluating makeVirtual. The only problem I noticed is that sometimes the items in the listview is not laid out properly on the first show. Maybe this has something to do with the problem I’m having?
 
Here is my code:

//this is actually assigned globally
var dataSource = new kendo.data.DataSource({
    transport: {
    read: {
     url: window.webserviceUrl + "/Search",
     dataType: "xml"
},
parameterMap: function(data, type) {
return String.format("categoryId={0}&place={1}&keywords={2}&countryName={3}&page={4}&pageSize={5}",
dataItem.id,
place,
keywords,
"Australia",
data.page,
pageSize);
   }
},
schema: {
type: "xml",
data: "/Products/product",
model: {
fields: {
                            id: "id/text()",
                            name: "name/text()",
                            highlight: "highlight/text()"
                            }
                    }
},
change: function(e) {
AW5.app.hideLoading();
},
pageSize: pageSize,
serverPaging: true
    });

    if ($("#product-list-1 .product-list").data("kendoMobileListView")) {
    $("#product-list-1 .product-list").data("kendoMobileListView").setDataSource(ds);
    }

AW5.app.navigate("#product-list-1");

///Template

    <!-- Category product list view -->
    <div id="product-list-#= instance #" data-role="view" class="member-only" data-module-instance="#= instance #" data-use-native-scrolling="true">
        <header data-role="header">
            <div data-role="navbar">
                <a class="nav-button" data-align="left" data-role="backbutton"></a>
                <span data-role="view-title">Search results</span>
            </div>
        </header>
        <ul class="product-list" data-source="ds (globally set)" data-role="listview" data-template="product-template" data-click="products.click" data-endless-scroll="true">
        </ul>
    </div>
Alexander Valchev
Telerik team
 answered on 01 Sep 2014
4 answers
84 views
I have an issue where I have a hidden column on my grid and selectable is set as "multiple cell".

I have two hidden columns that are hidden by default as the user can select them if they want to see additional data.

If I attempt to select cells while the columns are hidden the grid re-sizes and displays the data in a strange format. If I remove hidden columns then this behavior no longer occurs.
Dimiter Madjarov
Telerik team
 answered on 01 Sep 2014
1 answer
132 views
Hello,

When I use the toolbar inside a tabpanel it crashes when the tab item with the toolbar is activated. This only happens when I use the Razor method Resizable(false). If this method  is not called or called with input parameter true it works fine. Kendo crashes in the following toolbar function, the problem is that popup.close is undefined.

_resize: function(e) {
    var t = e.width;
    this.popup.close(), this._shrink(t), this._stretch(t), this._markVisibles(), this._toggleOverflowAnchor()
},

Kind regards,
Bert
Alexander Valchev
Telerik team
 answered on 01 Sep 2014
1 answer
79 views
Hello,

I want to create a line chart and bind the data using JSON file. This is my code but it is not working. 

 $("#line-chart1").kendoChart({
                theme: $(document).data("kendoSkin") || "BlueOpal",
                legend: {
                    visible: false
                },
                dataSource: {
                    transport: {
                        read: {
                            url: "Myjsonfile",
                            dataType: "json"
                        }
                    }
                },
                seriesDefaults: {
                    type: "Line"
                },
                series: [{
                    currentField: "current",
                    targetField: "target"
                }],
                valueAxis: {
                    majorUnit: 8000
                },
                tooltip: {
                    visible: true,
                    shared: true,
                    format: "N0"
                }
            });

This is my json file 

[{
    "current": 800,
    "target": 200
}]



Thanks.
Iliana Dyankova
Telerik team
 answered on 01 Sep 2014
1 answer
149 views
Hi,

I'm trying to implement a gallery feature - the pictures are displayed in a ScrollView and a click on the "Detailview" Button openes a Modalview which contains another Scrollview that is dynamically populated.

It works fine but I've problems with the second page of the ScrollView within the ModalView. It doesn't display the image but all other pages are working.

The strange thing is that this behavior only occurs in certain situations

- If I access the first page the second page is missing (not showing a picture) - all other pages are displayed correctly
- If I access the second page the picture is shown correctly but I can't scroll to the right side (as if there were no more items left) - A scroll to the left page resets the behaviour and all pictures can be scrolled correctly afterwards.
- If I access a page higher than the second one everything works as expected.

To see the described behavior you may find my example here: http://jsbin.com/pocumu/4/edit

I'm really puzzled why this behavior occurs - any help is appreciated.



Alexander Valchev
Telerik team
 answered on 01 Sep 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?