Telerik Forums
Kendo UI for jQuery Forum
1 answer
165 views
I would like to create a specific hierarchy of Manufacturers, Cars and Parts.

To achieve this, I would like to subclass kendo.data.Node as follows:

var Manufacturer = kendo.data.Node.extend({
//...
});
var Car = kendo.data.Node.extend({
//...
});
var Part = kendo.data.Node.extend({
//...
});

I would then like to subclass kendo.data.HierachicalDataSource, to represent such a hierarchy.

Question 1: How can I achieve that?

Data comes from a RESTful JSON service located at:
http://<ip address>/api/v1/manufacturers (GET, POST)
http://<ip address>/api/v1/manufacturers/<mid> (GET, PUT, DELETE)
http://<ip address>/api/v1/manufacturers/<mid>/cars (GET, POST)
http://<ip address>/api/v1/manufacturers/<mid>/cars/<cid> (GET, PUT, DELETE)
http://<ip address>/api/v1/manufacturers/<mid>/cars/<cid>/parts (GET, POST)
http://<ip address>/api/v1/manufacturers/<mid>/cars/<cid>/parts/<pid> (GET, PUT, DELETE)

Then I would like to instantiate my subclassed hierarchy to use this JSON service. 

Question 2:  How can I achieve that?





Alex Gyoshev
Telerik team
 answered on 06 Feb 2015
6 answers
5.8K+ views
I have a Kendo Grid we are using as part of a Document Manager style setup. We would like to have heartbeat functionality that automatically refreshes the grid when it detects changes on the server, checking every 60 seconds or so. Unfortunately, one of the objects in the grid is a Silverlight object which must remain in place to monitor a file on the local user's system (in the Silverlight Isolated Storage). If the UI gets refreshed, we lose the Silverlight object and it has to be regenerated.

I would like to stop any UI refresh that would result in the same document listing as what is currently there. Essentially, I need to use a hasChanges type functionality, but I don't know where to put it.

I've reviewed dataSource.hasChanges but the example just shows a fetch and then add, I don't know how this relates to the .read function automatically refreshing the UI.

Some example code to show where I'm coming from in this:

fileInformationDataSource = new kendo.data.DataSource({
        transport: {
            read: function (options) {
                kendo.ui.progress($("#fileInformationGrid"), true);
                var id = options.data.parentId;
                showHidden = options.data.showHidden;
                if (!id) { id = selectedTreeFolderId; }
                if (!showHidden) { showHidden = false; }
                // the below is a Spring implementation, it's basically just a fancy javascript to C# function caller with specific parameters
                DocumentWebService.GetFolderTreeInformation(documentTreeType, id,
                    utcOffsetInMins, isDstSupported, userId, showHidden,
                    function (result) {
                        options.success(result);
                        initializeMyDocuments();
                        kendo.ui.progress($("#fileInformationGrid"), false);
                    },
                    function (e) { options.error(e); }
                );
            }
        },
        batch: true,
        pageSize: 8,
        schema: {
            model: {
                id: "Id",
                fields: {
                    Id: { editable: false, nullable: true },
                    Name: {}
                }
            }
        }
    });

fileInformationGrid = $("#fileInformationGrid").kendoGrid({
    dataSource: fileInformationDataSource, sortable: false, pageable: true, autoBind: false,
    columns: [ /*my columns implementation */ ], selectable: "row",
    change: function () { /* starts a separate ajax call to pull file details for loading into another piece of UI */ }
});

// Read function implemented inside the heartbeat
// There is a separate Kendo Tree View which shows explorer style folder navigation, the selectedId is coming from that UI
fileInformationDataSource.read({ parentId: selectedId });





Alexander Valchev
Telerik team
 answered on 06 Feb 2015
7 answers
456 views
Hi Telerik,

We have an issue with kendo ui  Combobox control. Scenario is folowing: user wants to filter data not only by Company name but also by city in which this company is located.
Here is example of data :
{"Id":1,"Name":"AAA","City":"Amsterdam","Country":"The Netherlands"}

We wand to use composite client filter on Combobox together with Datasource. I simplified solution and put it here (http://jsfiddle.net/MbvgC/1/). Problem is that this solution is not work completely. When you have only one filter, then everything is ok, but if you add additional filter then combobox stops display any data:

filter: { 
        logic: "or",
        filters: [
               { field: "Name", operator: "contains" },
               { field: "City", operator: "contains" }
       ]
},

Can you tell us what is wrong with this approach?

Best regards,
Kiril Nikolov
Telerik team
 answered on 06 Feb 2015
1 answer
252 views
When binding a checkbox to an array property, it works only if array contains strings, but does not work with numbers:

<label><input type="checkbox" value="1"   data-bind="checked: colors" />Red</label>

var viewModel = kendo.observable({
    
//colors: ["1", "2", "3"] //works
    colors: [ 1, 2, 3 ] //does not work
});

Would be nice to remove this limitation to have a cleaner view model.
Here's a dojo representing it: http://dojo.telerik.com/uHaNO

Thanks.
Alexander Popov
Telerik team
 answered on 06 Feb 2015
1 answer
92 views
I'm trying to initialize Kendo Menu Widget inside the header of PanelBar. So far, I have been stuck with getting it to work together. What's the best way to achieve this? 
Dimiter Madjarov
Telerik team
 answered on 06 Feb 2015
3 answers
430 views
Hi,

we have problem with the binding, respectively the unbinding of the following viewmodel. If we try to undind the viewmodel we get an exception (undefined is not a function) which comes from the Binder.destroy method. kendo version is: 2013.3.1324

<div class="importantData" data-template="importantDataItem-Template" data-bind="source: getProperties"></div>


this.viewModel = kendo.observable({
                vm: this.ctx.get_viewModel(),
                properties: ["Modified"],
                getProperties: function () {
                    var vm = this.get("vm");
                    var array = [];
 
                    var properties = this.get("properties");
                    var length = properties.length;
                    for (var i = 0; i < length; i++) {
                        array.push(vm.get(properties[i]));
                    }
                    return array;
                }
            });
             
             
            kendo.bind(this.container, this.viewModel);

The other problem is, that the calculated function getProperties is called 4 or 5 times within the binding process.

Thanks in advance!
Michael
Alexander Valchev
Telerik team
 answered on 06 Feb 2015
2 answers
694 views
Hi,
I've added a kendo button which looks like this in HTML -
<a data-uid="a26bc1df-cc6a-402c-b5be-a983914ef703" class="q-btnHover k-button k-button-icon ng-scope" id="Refresh" data-overflow="auto" style="visibility: visible;"><img alt="icon" class="k-image" src="refresh.png"></a>

I want to change the image to refresh-hover.png on mouse hover on the button.

Please help.
Thanks and Regards
Devna
Devna
Top achievements
Rank 1
 answered on 06 Feb 2015
5 answers
199 views
Hi, I Have just started looking at the Kendo grid for the first time. I am looking for a (HTML5) grid that I can use for both desktop web and mobile (hyrib) applications.

I notice the grid has the scrolling mode of virtual. I have taken one of the online examples, set the scrolling to virtual, and also tried setting the mobile property to true, and 'tablet', however it does not appear to do the "kinetic " type of scrolling, at least not when I am running it in the desktop browser (Chrome) . 

....when I run an other mobile example, eg the endless-scrolling.html mobile example, this *does* exhibit the kinetic scrolling when run on my desktop Chrome, so I thought the grid would too...

So, my main question is, can the grid use the mobile type of kinetic / friction scrolling when being (at least when being run on a mobile device?)

Thanks in advance for any help/suggestions


Peter
Top achievements
Rank 1
 answered on 06 Feb 2015
1 answer
389 views
We like to create an angular spa webproject, where customers can build their dashboard using a sortable panel. Inside the sortable item there is a list of items which should be draggable to other windows (other Programs) to drop them there and read the assigned transfer data.
But I couldn't achieve this because everytime the whole widget takes the drag-events, not the single item.

Here some code:

I use some panels like this:
<div class="panel-wrap" panel-wrapper ng-controller="PanelCtrl as panelCtrl">
    <div ng-repeat="panelCol in panelCtrl.panels">
       <panel-column panel-col="panelCol"></panel-column>
   </div>
</div>

with each panel (directive 'panelColumn'):
<div class="col-sm-4 col-md-2" id="{{panelCol.id}}" kendo-sortable k-placeholder="panelCol.placeholder"
     k-hint="panelCol.hint" k-connect-with="{{panelCol.others}}">
    <my-item-list channel="panelCol"></my-item-list>
    <my-item-list channel="panelCol"></my-item-list>
</div>

and then the items for the panel (directive 'myItemList'):
<div class="widget k-widget" id="{{myCtrl.id}}">
        <span class="widget-header">
            <h4>
                <img ng-src="{{myCtrl.img}}" />
                {{myCtrl.title}}
                <span class="collapsed k-icon k-i-arrowhead-n pull-right"></span>
            </h4>
        </span>
        <div class="k-widget collapsablelist" style="height:400px;">
            <perfect-scrollbar class="scroller" wheel-propagation="true" suppress-scroll-x="true" wheel-speed="50"
                         refresh-on-change="someArray" on-scroll="onScroll(scrollTop, scrollHeight)">
                <div ng-repeat="d in myCtrl.data">
                    <my-item item="d"></my-item>
                </div>
            </perfect-scrollbar>
        </div>
    </div>

and here
<div class="item"ng-style="{'border-left-color': item.color }" item-draggable="true" draggable="true">
   .. some content here ...
</div>


I tried all of the examples but couldn't find a solution for this problem. Also tried to use the plain jquery sortable as in the panel example (even with handle) but no luck.

Could you please give me a hint or even better an example how to drag some thing out of a sortable panel?

Best regards
Gerd
Alexander Valchev
Telerik team
 answered on 05 Feb 2015
1 answer
181 views
I'm facing an alleged Kendo UI treeview bug in the Angular version.

The tree node renders correctly (Item 2) but when it is expanded to show the sub nodes the text changes to {{dataItem.text}}
This also happens when adding a new sub node to a tree.

Since I can easily reproduce this on kendo's own demo site. I know its not my code:
http://demos.telerik.com/kendo-ui/treeview/angular

I recently upgraded from Kendo UI v2014.3.1119 To v2014.3.1316. In 1119 the issue is not happening.

Any thoughts on what I can do as a work around or when a bug fix might me expected. At this time reverting to 1119 is not an option due to the fact we need to take advantage of some of the new features in 1316
Alex Gyoshev
Telerik team
 answered on 05 Feb 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
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?