Telerik Forums
Kendo UI for jQuery Forum
3 answers
388 views
I have having a tough time figuring out how to achieve simply bindings in a tree view template:

This is my requirement:

- Bind checkbox of each node to an isVisible property on the node's underlying view model.  
- Bind click action of delete button to a method called remove() on the node's underlying view model.   

Treeview is bound to an underlying hierarchical datasource.  Items in datasource are created and added dynamically like this:


        createCategoryLegendModel(viewModel) {             
             return {
                 text : viewModel.label,
                 imageUrl:  this.url + viewModel.imagePath,  
                 expanded : true,                                    
                 viewModel: viewModel,
                 callme: function () { alert("view model called"); },  // test method            
                 layers :  [] 
             };
         }

dataSource.add(createCategoryLegendModel(viewModel));

This is the template I have:

<script id="treeview-template" type="text/kendo-ui-template">           
        <input type="checkbox" data-bind="checked : item.viewModel.isVisible" style = "margin-left:-5px"></input>                 
        <img data-bind="click : callme" title="click to remove"  src="@Url.Content("~/images/delete.png")" style ="margin-top:0px; height:16px; width:16px"/>          @* or item.viewModel.remove, which ever I can get to work *@
        <span> #: item.viewModel.label #</span>                    
        <span data-bind="text : text"> </span>          @* why does this not work *@    
</script>


Now, your checkbox example, shows how to render, but does not show us how to bind to an underlying view model.  So it does not really help me much.  Your  templates shows me how to render a button, but not how to bind its click to an underlying view model method yet these are things easily done using Knockout.   Also, I the way you bind click actions on the delete button in your templates sample, is susceptible to performance problems and breaks down my MVVM strategy.
Klaus
Top achievements
Rank 1
 answered on 21 Feb 2013
1 answer
72 views
Can I use kendoDropDownList with kendo mobile license ? I can see that is in kendoDropDownList kendouiweb section.
Sebastian
Telerik team
 answered on 21 Feb 2013
3 answers
41 views
How can i get a scroll bar like on sitefinity.com?

Does it use kendo UI ?
Sebastian
Telerik team
 answered on 21 Feb 2013
1 answer
44 views
I didn't know where to put this.
It looks like this demo the code and what is rendered at the top do not match. http://demos.kendoui.com/web/grid/rowtemplate.html

the rendered has rows with column headings 
Cover Title Rating


and this is what the code says they should be.

.Columns(columns =>
    {
        columns.Bound(c => c.CustomerID).Title("Picture");
        columns.Bound(c => c.ContactName).Title("Name");
        columns.Bound(c => c.CompanyName);
        columns.Bound(c => c.Country);
        columns.Bound(c => c.Address);
        columns.Bound(c => c.Phone);
    })

I still get the concept I think but it would be nice if they actually matched.l

Atanas Korchev
Telerik team
 answered on 21 Feb 2013
1 answer
438 views
I have a remote data source (rds) that will deliver the tree view nodes items.
Elsewhere on the page there will be check boxes to allow the subtrees of various campaigns to be turned on and off.

The treeview template setting appears to only affect the 'k-in' span of a 'treeitem' li as rendered by the treeview control.

My situations is that the rds will supply additional item data about the nature of the item
{ id: ..., hasChildren: true, data:{addClass:'Campaign1'} }


I want the data.addClass value added to the class of the containing <li> that will be rendered.

The outcome desired looks like 
<li role="treeitem" class="k-item ... Campaign1" data-uid="..." id="...">
<div class="k-top/mid/bot"
<span class="k-icon ..." role="presentation"></span>
<span class="k-in"> TEMPLATE RENDERING GOES HERE </span>
</div>
</li>

Is there a way some javascript in the template setting can perform the desired tweak on the <li>?
Will I need to handle a 'children-loaded' event and iterate over the freshly rendered nodes ?

Petur Subev
Telerik team
 answered on 21 Feb 2013
2 answers
270 views
I'm trying to create a linear gauge, where ONLY the pointer is shown. The scale and all other furniture needs to be hidden, as we are displaying the pointer over a custom image in our web page.
My code for the gauge so far is as follows:

@(Html.Kendo().LinearGauge().Name("LinGauge" + @Model.ComponentName.Replace(" ",""))
    .Pointer(pointer => pointer.Size(30.0)
                   .Color("Black")
                   .Value(@Model.ComponentScore / 1000.0)
                   .Shape(GaugeLinearPointerShape.Arrow))
    .Scale(scale => scale.Min(0.0)
                 .Max(1.0)
                 .Vertical(false)
                 .MinorTicks(t => t.Visible(false))
                 .MajorTicks(t => t.Visible(false))
                 .Labels(l=>l.Visible(false))))

This is almost there, and displays the pointer with just a single, undecorated line where you would expect the scale to be (see attached image), but I can't seem to find in the API reference how you would switch that line off. Any help would be appreciated.

Chris
Top achievements
Rank 1
 answered on 21 Feb 2013
1 answer
221 views
Hi,

I'm evaluating Kendo UI for our web / mobile project at the moment. I have browsed through the documentation and did not find much information on customizing chart Markers. I am looking for something similar to this high chart demo (specifically the marker line that shows up when you mouse over the data points). Can this functionality be replicated via Kendo UI DavaViz? Also, can we grab the tooltip values on mouse over and display it somewhere else on the chart; lets say near the legend?

http://www.highcharts.com/demo/line-ajax


Iliana Dyankova
Telerik team
 answered on 21 Feb 2013
14 answers
374 views
Since I have update my trial version(it was 2012.3.1314) to commercial version(2012.3.1315)
) we got a new issue. Column reordering does not work at all. I think it is an issue with kendoDraggable. Here is the JsFidddle .

Here is the GithHub issue
Alexander Valchev
Telerik team
 answered on 21 Feb 2013
2 answers
136 views
Given something along the lines of below I am trying to use the custom editor function of the grid to show a different control based on the data type.  Data types are not limited to string, date, and boolean, but would also include some custom lists.  In the demo for custom editors on fields the demo leads me to believe that the editor is column based, and cannot be row based.  Is there a way to accomplish row based editors on the grid control?
<div id="me">
    <div id="kendoGrid"></div>
</div>
 
<script type="text/javascript">
    var viewModel = {
        items: []
    };
 
    viewModel.items.push({ id: 0, dataField: new Date(2012, 1, 1), dataType: 'date' });
    viewModel.items.push({ id: 1, dataField: 'any string', dataType: 'string' });
    viewModel.items.push({ id: 2, dataField: true, dataType: 'boolean' });
 
    $(document).ready(function () {
        $("#kendoGrid").kendoGrid({
            dataSource: {
                data: viewModel.items,
                batch: true,
                schema: {
                    model: {
                        id: "id",
                        fields: {
                            id: { editable: false, nullable: false },
                            dataField: {}
                        }
                    }
                }
            },
            columns: [{
                field: "dataField",
                title: "Attribute Value"
            }],
            editable:true
        });
    });
</script>
Phil
Top achievements
Rank 1
 answered on 21 Feb 2013
1 answer
50 views
If the value axis max is under 1,000 it works fine.  But when the max exceeds 1,000 the chart is blank.

What am I missing.
Iliana Dyankova
Telerik team
 answered on 21 Feb 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)
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
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
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?