Telerik Forums
Kendo UI for jQuery Forum
1 answer
313 views
Hi,

I have a very simple tree view by using html tags as below:

I try to use jQuery to loop through the data for each level.

When I called the chidlren("li") function, it's supposed to return the nodes in next level.

But it returned null.
 
        // loop the second level
        // second level 2
        $("ul#treeview > li > ul > li").each(function () {

            var parentId = "parentId";
            var parentText = $(this)[0].firstChild.textContent;
            
            // go down to the next level    <-- the method children("li") return null, but it's supposed to return the li element in the next level
            $(this).children("li").each(function () {
                //alert($(this).text());
                var subId = "ChildId";
                var subText = $(this).text();
               // alert(subId + " " + subText);
                
                var subItem = { id: subId, name: subText };
                // add the item into array
                subData.push(subItem);
            });


           // var subItems = subData;
            var item = { id: parentId, name: parentText, items: subData };


            data.push(item);
        });


    <ul id="treeview">
        <li data-expanded="true">
            <span class="k-sprite folder"></span>Active Adapters
                <ul>
                    <li data-expanded="true">
                        <span class="k-sprite folder"></span>Adapter 1
                                <ul>
                                    <li><span class="k-sprite html"></span>
                                        <input type="checkbox" id="1" style="margin-bottom: 5px;" /><a href="#" class="bootstrap-custom-link1">Sub1</a></li>
                                    <li><span class="k-sprite html"></span>
                                        <input type="checkbox" id="2" style="margin-bottom: 5px;" /><a href="#" class="bootstrap-custom-link1">Sub2</a>   </li>
                                </ul>
                    </li>
                    <li data-expanded="true">
                        <span class="k-sprite folder"></span>Adapter 2
                                <ul>
                                    <li><span class="k-sprite html"></span>
                                        <input type="checkbox" id="3" style="margin-bottom: 5px;" />&nbsp;<a href="#" class="bootstrap-custom-link1">Instance 1</a></li>
                                    <li><span class="k-sprite html"></span>
                                        <input type="checkbox" id="4" style="margin-bottom: 5px;" />&nbsp;<a href="#" class="bootstrap-custom-link1">Instance 2</a></li>
                                </ul>
                    </li>
    </ul>
Nohinn
Top achievements
Rank 1
 answered on 10 Sep 2012
1 answer
310 views
validation on dropdownlist not working. I want to show also validation summary on the top of the form. please give me any suggestion. i think the validation summary is not available in kendo ui. i want to show all validation messages on the top of form..
Mk
Top achievements
Rank 1
 answered on 10 Sep 2012
0 answers
88 views
Does anyone suggest how can I get the value what has been grouped?
In group.png the user save the group of order then how can I get the value that user grouped the order
the 2nd is group1.png how can I get the value when user save the group order-customer?
does anyone suggest or help me how to deal with that problem

Here's other link of image
group
group1

Chretien Kevin
Top achievements
Rank 1
 asked on 10 Sep 2012
8 answers
274 views
I am trying to loads multiple window on runtime based on my xml configure.Xml contains like window name,height,width,url
using "for" loop to creating window 
But i am not able to load the multiple window on Runtime
Please advice me ,how to proceed futher.

Code Sample
        for (var i = 0, sl = jsonDoc.widget.length; i < sl; i++)
          {
             var panelname;
             panelname = "#panel" + i;
             $(panelname).kendoWindow(
             {
                draggable: true,
                name: jsonDoc.widget[i].name,
                title: jsonDoc.widget[i].title,
                height: jsonDoc.widget[i].height,
                width: jsonDoc.widget[i].width,
                resizable: true,
                actions: ["Minimize", "Maximize", "Refresh", "Close"],
                content: {
                    url: jsonDoc.widget[i].url
                }
              });
            }


 

 

 

 

 

 

Prakash
Top achievements
Rank 1
 answered on 10 Sep 2012
3 answers
243 views
Hi,

This is a strange problem. I have a grid with dates from ASP.NET MVC. In the grid the dates are look OK.
I'm using "hu-HU" globalization.
When I update, or create a row, the sended date is this format: Wed Aug 1 17:32:58 UTC+0200 2012
This looks like in httpencoding in GET: projects%5B0%5D.start=Wed+Aug+01+2012+00%3A00%3A00+GMT%2B0200+(K%C3%B6z%C3%A9p-eur%C3%B3pai+ny%C3%A1ri+id%C5%91) 
And here it is my MVC controller action:
public JsonResult CreateProject(IEnumerable<ProjectViewModel> projects){...}

When I check projects I see that date's parsed failed so I see my Datetimes in my incoming object: {0001.01.01. 0:00:00}

Please advice, what should I do for good date communication protocol?

Thank you very much!
Sig
Top achievements
Rank 1
 answered on 10 Sep 2012
6 answers
286 views
The input renders out with required, then it gets the datepicker applied, then on click, the validation gets called

...am I doing something wrong with it?

**ignore "datepicker.PNG"** attached by accident, have a look at the other image
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 09 Sep 2012
1 answer
76 views
Hi, for create Large Web Applications, it's enough with Kendo, MVVM, DataSource, Template bindings, etc, 

or I need to also use any framework like Backbone or Knockout, Ember, or other?

What do You think about this?


Thanks.



IsmiKin
Top achievements
Rank 1
 answered on 09 Sep 2012
1 answer
139 views
Bottom line: How do I load items in a dropdown list from a different url after it's been initialized?

I have a 3 dropdown lists that are bound to 3 kendo data sources which read json from 3 different endpoints. I want to be able to select something from the first dropdown, and have the second and third dropdowns change. Just as an example, if the first dropdown is names of grandfathers, second dropdown is list of fathers and third dropdown is a list of sons, the third dropdown should only list sons related to the selected father, and the second dropdown should only list fathers related to the selected grandfather.

Cascading dropdowns aren't useful because I'm graphing data about grandfathers, fathers, and sons regardless of their relationships.

The endpoints are:
  1. "service/getGrandfatherList/"
  2. "service/getFatherList/grandfatherID"
  3. "service/getSonList/fatherID"
Problem is, I can't get the second and third dropdowns to change. In my onclose event handler I've tried:
  • $("fathers").data("kendoDropDownList").dataSource.read(); as suggested in this thread
  • Re-initializing the dropdown list, though that makes it disappear (see thread linked above)
  • Assigning the kendo data source to a new kendo.data.DataSource that reads from the appropriate URL then calling datasource.read(), datasource.fetch(),dropdownlist.refresh()
Those do nothing. What's weird is that even after assigning the data source to a new datasource and calling fetch(), it reads from the old url instead of the new one.

Hope I've explained this properly... any ideas?
Roderick
Top achievements
Rank 1
 answered on 09 Sep 2012
1 answer
178 views
Running Kendo UI 2012.2.710.340 in a MVC 4 .NET Web App.

When the page posts I get a java script error of
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method

Rendered Java Script that is throwing the error
<div class="k-widget k-grid" id="gridDocumentType"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-add" href="/DocumentType?gridDocumentType-mode=insert"><span class="k-icon k-add"></span>Add new item</a></div><div class="k-grid-header"><div class="k-grid-header-wrap"><table cellspacing="0"><colgroup><col /></colgroup><tr><th class="k-header k-filterable" data-field="Name" data-title="Name" scope="col"><a class="k-grid-filter"><span class="k-icon k-filter"></span></a><a class="k-link" href="/DocumentType?gridDocumentType-sort=Name-asc">Name</a></th></tr></table></div></div><div class="k-grid-content" style="height:200px"><table cellspacing="0"><colgroup><col /></colgroup><tbody><tr><td>Adoption Assistance</td></tr><tr class="k-alt"><td>CPS Child Fatality</td></tr><tr><td>CPS Non-Fatality</td></tr><tr class="k-alt"><td>CSA Case Manager</td></tr><tr><td>CWBC</td></tr><tr class="k-alt"><td>Education</td></tr><tr><td>Family</td></tr><tr class="k-alt"><td>Home County Child</td></tr><tr><td>Resource Home</td></tr></tbody></table></div><div class="k-pager-wrap k-grid-pager"><a class="k-link k-state-disabled" data-page="1" href="#" title="Go to the first page"><span class="k-icon k-i-seek-w">seek-w</span></a><a class="k-link k-state-disabled" data-page="0" href="#" title="Go to the previous page"><span class="k-icon k-i-arrow-w">arrow-w</span></a><ul class="k-pager-numbers k-reset"><li><span class="k-state-selected" data-page="1">1</span></li></ul><a class="k-link k-state-disabled" data-page="2" href="#" title="Go to the next page"><span class="k-icon k-i-arrow-e">arrow-e</span></a><a class="k-link k-state-disabled" data-page="1" href="#" title="Go to the last page"><span class="k-icon k-i-seek-e">seek-e</span></a><span class="k-pager-info k-label">1 - 9 of 9 items</span></div></div><script>
    jQuery(function(){jQuery("#gridDocumentType").kendoGrid({columns:[{title:"Name",field:"Name",encoded:true,editor:null}],pageable:{},sortable:true,filterable:true,editable:{confirmation:"Are you sure you want to delete this item?",mode:"popup",template:"\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"ID\"\u003eID\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-number=\"The\u0026\\#32;field\u0026\\#32;ID\u0026\\#32;must\u0026\\#32;be\u0026\\#32;a\u0026\\#32;number.\" data-val-required=\"The\u0026\\#32;ID\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"ID\" name=\"ID\" type=\"number\" value=\"0\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"ID\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"DispositionRuleID\"\u003eDispositionRuleID\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-number=\"The\u0026\\#32;field\u0026\\#32;DispositionRuleID\u0026\\#32;must\u0026\\#32;be\u0026\\#32;a\u0026\\#32;number.\" data-val-required=\"The\u0026\\#32;DispositionRuleID\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"DispositionRuleID\" name=\"DispositionRuleID\" type=\"number\" value=\"0\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"DispositionRuleID\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"Name\"\u003eName\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-required=\"The\u0026\\#32;Name\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"Name\" name=\"Name\" type=\"text\" value=\"\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Name\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"rowguid\"\u003erowguid\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-required=\"The\u0026\\#32;rowguid\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"rowguid\" name=\"rowguid\" type=\"text\" value=\"00000000-0000-0000-0000-000000000000\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"rowguid\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"HasValue\"\u003eHasValue\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"check-box\" data-val=\"true\" data-val-required=\"The\u0026\\#32;HasValue\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"HasValue\" name=\"HasValue\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"HasValue\" type=\"hidden\" value=\"false\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"HasValue\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e",window:{modal:true,draggable:true,resizable:false}},toolbar:{command:[{name:null,buttonType:"ImageAndText",text:"Add new item"}]},dataSource:{transport:{read:{url:"/DocumentType"},update:{url:"/DocumentType/Edit"},create:{url:"/DocumentType/Create"},destroy:{url:"/DocumentType/Delete"}},pageSize:10,page:1,total:9,serverPaging:true,serverSorting:true,serverFiltering:true,serverGrouping:true,serverAggregates:true,type:"aspnetmvc-ajax",filter:[],error:error,schema:{data:"Data",total:"Total",errors:"Errors",model:{id:"ID",fields:{ID:{type:"number"},DispositionRuleID:{type:"number"},Name:{type:"string"},rowguid:{type:"object"},HasValue:{editable:false,type:"boolean"}}}},data:{Data:[{"ID":1,"DispositionRuleID":7,"Name":"Adoption Assistance","rowguid":"19adf557-b31e-4c81-a9f2-abac883059f5","HasValue":true},{"ID":5,"DispositionRuleID":2,"Name":"CPS Child Fatality","rowguid":"6ca6be67-b96a-482a-864c-f0fa57eb364a","HasValue":true},{"ID":6,"DispositionRuleID":2,"Name":"CPS Non-Fatality","rowguid":"430c28aa-b05c-482f-8250-a83cca375504","HasValue":true},{"ID":3,"DispositionRuleID":2,"Name":"CSA Case Manager","rowguid":"d49942f9-9677-4e2c-8614-651e957f69d7","HasValue":true},{"ID":4,"DispositionRuleID":2,"Name":"CWBC","rowguid":"c265db91-2c10-415d-80ba-8f62eb24f9b1","HasValue":true},{"ID":9,"DispositionRuleID":2,"Name":"Education","rowguid":"1495df11-8192-4596-aa2d-93c0d76d03aa","HasValue":true},{"ID":8,"DispositionRuleID":2,"Name":"Family","rowguid":"3207a8ce-589d-44d9-993f-49f1c7f37770","HasValue":true},{"ID":2,"DispositionRuleID":2,"Name":"Home County Child","rowguid":"600987f3-56b9-4338-bf33-49b46c3e9990","HasValue":true},{"ID":7,"DispositionRuleID":2,"Name":"Resource Home","rowguid":"8a7a12f8-c84b-4096-bbce-4dd03499863c","HasValue":true}],Total:9}}});});
</script>

Razor Code
@model IEnumerable<WitWiyD.Models.DocumentType>
 
@{
    ViewBag.Title = "Index";
}
 
<h2>Index</h2>
 
<p>
    @Html.ActionLink("Create New", "Create")
</p>
 
@(Html.Kendo().Grid(Model)
    .Name("gridDocumentType")
    .ToolBar(toolbar => {
        toolbar.Create();   
    })
    .Columns(columns =>
    {
        columns.Bound(p => p.Name);
    })
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()   
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => model.Id(p => p.ID))
        .Events(events => events.Error("error"))
        .Read(read => read.Action("Index", "DocumentType"))
        .Create(create => create.Action("Create","DocumentType"))
        .Destroy(destroy => destroy.Action("Delete","DocumentType"))
        .Update(update => update.Action("Edit","DocumentType"))     
     )
)
 
@*<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.rowguid)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.HasValue)
        </th>
        <th></th>
    </tr>
 
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.rowguid)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.HasValue)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}
 
</table>*@
<script>
function error(e) {
    if (e.errors) {
        var message = "Errors:\n";
        $.each(e.errors, function (key, value) {
            if ('errors' in value) {
                $.each(value.errors, function() {
                    message += this + "\n";
                });
            }
        });
 
 
    alert(message);
}
 
 
}
</script>

Any ideas?
Paul
Top achievements
Rank 1
 answered on 08 Sep 2012
0 answers
370 views
When using editor templates by name like:

columns.Bound(x => x.Name).EditorTemplateName("String").Width(300);

Causes this to be rendered:

{"title":"Name","width":"300px","field":"Name","encoded":true,"editor":"%3cinput class=\"text-box single-line\" data-val=\"true\" data-val-required=\"Please provide a setting name.\" id=\"Name\" name=\"Name\" type=\"text\" value=\"\" /%3e%3cspan class=\"field-validation-valid\" data-valmsg-for=\"Name\" data-valmsg-replace=\"true\"%3e%3c/span%3e"}

Which then causes the grid, when inline editing to show the html encoded rather than endering the actual html it represents. I see an "encoded:true" but it doesn't seem to be treating the editor as encoded.

Thanks in advance.

EDIT: I blogged a workaround.

http://pknopf.com/blog/kendo-ui-editor-templates-for-asp-net 
Paul
Top achievements
Rank 1
 asked on 08 Sep 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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
Gauges
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
ScrollView
PivotGridV2
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
+? 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?