Telerik Forums
Kendo UI for jQuery Forum
2 answers
87 views
I have a Kendo UI Web treeview configured to do OnDemand loading from a remote dataservice using JSON and ODATA.  This is working very well, and I have been very pleased.

My issue comes to light when programmatically selecting a node in the tree, and then clicking its expand icon.  What occurs is that the selection immediately jumps to the first root node.  However, if before or after expanding, you manually select (using your mouse) a node then this behavior stops occurring.

I also notice that when programmatically selecting a node I lose my focused node, but that the focus returns whenever a manual selection is made (using your mouse).

I am not sure that these behaviors are related in anyway, and frankly I do not need the focus, my big issue is the selection changing when all that is done is merely expanding the selected node.

So, to recreate:

1) Setup a treeview in the fashion I described above (with 4 levels)
2) Load the treeview's root nodes (1st level) (rest of the nodes are loaded on-demand when expand occurs)
3) Programmatically expand the first root node to the 3rd level down (arbitrary level #)
3) Programmatiically select this node (with children) on the 3rd level
4) Now it is time for the user to interact with the tree  (Notice at this point how no node has focus (cant keyboard navigate)
5) Merely, expand the currently selected node to view its children
6) Notice, the selection has jumped to the first root level node (but also notice now how this node has focus)

As I said before, my most impeding issue at this point is the selection changing.

Do you know how I can prevent the selection from changing when I just expand the programmatically selected node?


Thanks,

Lee
Lee
Top achievements
Rank 1
 answered on 18 Jun 2013
4 answers
144 views
Hi,

I am using Datagrid and would like to add the error handle function. Follow the doc from Kendo and I change the code as below in sample project. But the error always fired no matter with error or not. Can support team help? Many thanks, George

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()    
    .Name("grid")
    .Columns(columns => {
        columns.Bound(p => p.OrderID).Filterable(false).Width(100);
        columns.Bound(p => p.Freight).Width(100);
        columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}").Width(140);
        columns.Bound(p => p.ShipName);
        columns.Bound(p => p.ShipCity).Width(150);
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("Orders_Read", "Grid"))
        .Events(events => events.Error("alert('errorAlert')"))
     )
)



public ActionResult Orders_Read([DataSourceRequest]DataSourceRequest request)
        {
            return Json(GetOrders().ToDataSourceResult(request));
        }
Daniel
Telerik team
 answered on 18 Jun 2013
1 answer
90 views
Hello! I have a problem with binding MVVM objects to action parameters.

When I have on client side in viewmodel array of observable objects (for example (pseudocode) array TestArray: 0 {Id: 3, Name: 'qwe', State: 2}, 1 {Id: 5, Name: 'rty', State: 3}) and I post this from popup window (grid editing), on server side I get such form values: TestArray[0][Id], TestArray[0][Name], TestArray[0][State], TestArray[1][Id], TestArray[1][Name], TestArray[1][State]
But I expect to get: TestArray[0].Id, TestArray[0].Name etc., becouse I want MVC to bind this data to IEnumerable of custom type (public int Id, public string Name, public int State).

Can you give me advise how to solve this problem, thank tou
Daniel
Telerik team
 answered on 18 Jun 2013
2 answers
318 views
I have a VM has a DataSource in it.

var layerTable = new kendo.data.DataSource();
When new data arrives, I am able to populate the LayerTable with the data() function. But I also want to dynamically add in aggragates to this.

1.vm.SetLayers = function(values) {
2.    this.LayerTable.data(values);
3.    this.LayerTable.aggregate = [{ field: "FileCount", aggregate: "count" }];
4.    //this.trigger("change", { field: "LayerTable" });
5.};
I am finding that when I later try to get the aggregates() I get an empty object.

1.vm.LayerTable.aggregates();

Dr.YSG
Top achievements
Rank 2
 answered on 18 Jun 2013
1 answer
52 views
It took me a full day to realize it was the way Kendo was perceiving the data and not something I was doing, to come to the conclusion that Pie charts will not display properly if the data handed to it is in a string format, however all other charts are fine. I've been working on a dashboard and passing all data to the browser in the same manner until I tried drawing pie charts. This is more of a "in-case anyone comes across this issue" or even something for the Telerik team to put in as a fix, but I made a jsbin example to demonstrate the problem

http://jsbin.com/anezec/2/edit

I'm just curious as to why the lines have no problem display but the pie charts do?
Hristo Germanov
Telerik team
 answered on 18 Jun 2013
2 answers
2.7K+ views
Hello,

I'm working on implementing a stacked bar chart solution with one vertical column, but would like to increase the width of this vertical bar to fill the entire chart container it resides in (see screenshot).  Is there a way to increase just the width of this bar?

This is my JS:

function createChart() {
                    $("#chart").kendoChart({
chartArea: {
background:"#f3f3f3",
margin:0,
padding:0
},

                      legend: {
                            visible: false,

},
                        seriesDefaults: {
                            type: "column",
stack: true,
width:90
},

series: [{
name: "Interest",
                            stack: "Mortgage",
                            data: [494.50],
color: "#f58025",
width:90
                        }, {
                            name: "Taxes",
                            stack: "Mortgage",
                            data: [375],
color: "#f58025"
                        }, {
                            name: "Principle",
                            stack: "Mortgage",
                            data: [269],
color: "#f58025"
                        }, {
                            name: "PMI",
                            stack: "Mortgage",
                            data: [200],
color: "#f58025"
                        }, {
                            name: "Rollover",
                            stack: "Mortgage",
                            data: [75],
color: "#f58025"
                      
                         }, {
                            name: "Insurance",
                            stack: "Mortgage",
                            data: [50],
color: "#f58025"
}],
                        valueAxis: {
color:"#ff0000",
max:1450,

labels:{
color:"",
visible:false
},
line: {
                                visible: false
                            },
majorGridLines: {
                                visible: false
                            },

                        },
                        categoryAxis: {
color:"",
justified:true,
categories: ["Ex"],
width:2,
                            

majorGridLines: {
                                visible: false
                            },
crosshair: {
 width: 2,
 visible: true
},
},
                        tooltip: {
                            visible: true,
                            template: "#= series.name #: #= ['$']+value #"
                        }
                    });
                }



Thank you!
Randy
Top achievements
Rank 1
 answered on 18 Jun 2013
7 answers
585 views
Hi,

I have been using kendo treeview to display Menu.
Below is my tree view
$("#treeview").kendoTreeView({
                template: '# if(item.isOvr) { # <b>#=item.txt#</b># } else { ##=item.txt## }#',
                select: function (e) {
                    if (this.dataItem(e.node) != null) {
                        this.expand(e.node);
                    }
                },
                dataSource: inlineDefault
            });

var inlineDefault = new kendo.data.HierarchicalDataSource({
                transport: {
                    read: {
                        cache: false,
                        url: "/menu/GetTree",
                        dataType: "json",
                        data: { 'id': $('#menuId').val(), 'netId': $('#networkId').val(), 'breakcache': new Date().getTime() }
                    }
                },
                schema: {
                    model: {
                        id: "id",
                        children: "Items",
                    }
                }
            });

Each Item have following properties:

var item = {
                id: id,
                actualid: actaulId,
                typ: menutype,
                prnt: parent,
                txt: text,
                isOvr: isOverride
            };

How Can I update all the properties of a single node? 
or refresh all the children from database of particular node.
Daniel
Telerik team
 answered on 18 Jun 2013
3 answers
386 views
I have a kendo grid for user managment when I go  to edit a user fields that are nullable byte keep on saying that the fields are required if i don't select a value for them.

Here is my view code for these and model.

<div class="phoneNumberEntry">
                    <div class="phoneModalDropdown">@Html.DropDownListFor(model => Model.Phone1.PhoneTypeId, ViewBag.PhoneTypeList1 as SelectList, new { @style = "width: 105px" })</div>
                    <span class="phoneNumber">@Html.EditorFor(model => Model.Phone1.PhoneNumber)</span>
                    <span class="extension">@Html.EditorFor(model => Model.Phone1.PhoneExtension)</span>
                    <span class="isPrimary">Primary: <input type="checkbox" data-bind="checked: Phone1.IsPhonePrimary"/></span>
                </div>
 
                <div class="phoneNumberEntry">
                    <div class="phoneModalDropdown">@Html.DropDownListFor(m => m.Phone2.PhoneTypeId, ViewBag.PhoneTypeList2 as SelectList, "Select Type", new { @style = "width: 105px" })</div>
                    <span class="phoneNumber">@Html.EditorFor(model => Model.Phone2.PhoneNumber)</span>
                    <span class="extension">@Html.EditorFor(model => Model.Phone2.PhoneExtension)</span>
                    <span class="isPrimary">Primary: <input type="checkbox" data-bind="checked: Phone2.IsPhonePrimary"/></span>
                </div>
 
                <div class="phoneNumberEntry">
                    <div class="phoneModalDropdown">@Html.DropDownListFor(m => m.Phone3.PhoneTypeId, ViewBag.PhoneTypeList3 as SelectList, "Select Type", new { @style = "width: 105px" })</div>
                    <span class="phoneNumber">@Html.EditorFor(model => Model.Phone3.PhoneNumber)</span>
                    <span class="extension">@Html.EditorFor(model => Model.Phone3.PhoneExtension)</span>
                    <span class="isPrimary">Primary: <input type="checkbox" data-bind="checked: Phone3.IsPhonePrimary"/></span>
                </div>
 
public class PhoneType
    {
        public string PhoneTypeDesc
        { get; set; }
        public byte? PhoneTypeId
        { get; set; }
    }
Petur Subev
Telerik team
 answered on 18 Jun 2013
1 answer
29 views
Hi,

I have a
drag and drop treeview and on the drop event I would like to verify if we are
droping over a node. If we do, force the node to drop after that node?

The result
would then be: When people drop an element on another element it would just
appear under the node and not as it's child.

 

Thank you

Petur Subev
Telerik team
 answered on 18 Jun 2013
1 answer
1.2K+ views
Hello,

I have 9 DropDownListFor that cascades from other DropDownList. I need to disable validation for DropDownLists that has no items. How to do it ?
Alexander Valchev
Telerik team
 answered on 18 Jun 2013
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)
SPA
Filter
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
TimePicker
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?