Telerik Forums
Kendo UI for jQuery Forum
1 answer
138 views
My problem is
I have this pattern in json format
{"data":[{"name":"John","street":{"street_name":"Square"},"id":"9"},{"name":"Annita","street":{"street_name":"Half"},"id":"8"}]}
How i cant show the street_name like a column in the grid without dropdown it is a field information 
thanks
I do not know if I explained well

Hardeep
Top achievements
Rank 1
 answered on 10 Dec 2012
2 answers
713 views
Hi, I am currently developing an app that has two listviews, one on the mainview, and another on the secondary view, both which are using remote data call using jsonp. the items generated on the first listviews are links to the next listview, I know it sounds confusing, basically im using jquery to grab an attribute from an element on the main listview and that is used for the URL of the new listview, similar to the problem in this forum: http://www.kendoui.com/forums/mobile/listview/mobile-listview-is-not-refreshing-on-button-click.aspx 

here is a copy of my code, hope you can understand and help me out here
Im having trouble loading the second listview with a dynamic URL
       <!--Main view-->
       <div data-role="view" data-init="mobileListViewDataBindInitFlat" data-title="ClickView 24/7 Alerts" id="mainView"  >
           <ul data-role="listview" data-style="inset" data-type="group"  id="result"></ul>
       </div>
       <!--Alerts Display view -->
       <div data-role="view" id="displayPage" data-title="ClickView 24/7 Alerts"  data-init="mobileListViewint" >
           <ul  data-role="listview" id="datashow"   >
           </ul>
       </div>
 
           <!--main layout-->
           <div id="layout" data-role="layout" data-id="main-layout">
               <div data-role="header">
                   <div data-role="navbar">
                       <span data-role="view-title"></span>
                   </div>
               </div>
                   <div data-role="footer">
                       <div data-role="tabstrip">
                           <a href="#mainView" data-icon="home">Home</a>
                           <a href="#alertPage" data-icon="favorites">Alerts</a>
                       </div>
                   </div>
           </div>
            
           <!-- Main Listview Template-->
           <script type="text/x-kendo-template" id="showtemp">
               <a class="show" href="\#displayPage" data-show="${ProgramId}">
               <span class="date">${Start}</span>
               <h2>${Title}</h2>
               <h3 class="chan">${Channel}</h3>
               <p class="descript">${Description}</p>
               </a>
                    
           </script>
            
           <!-- Alerts Listview Template-->
           <script type="text/x-kendo-template" id="datatemp">        
                    
                   <h3 class="keyword">Keyword: #: Keyword#</h3>
                   <a class="actionbutton"data-role="detailbutton" data-style="contactadd"></a>
                   <p class="subtime">#: SubTime#</p>
                   <p class="subtext">#: SubText#</p>
           </script>
 
<script>
           window.app = new kendo.mobile.Application(document.body,{transition: "slide", layout: "main-layout"});
            
           //Main ListView initialiser
           var showDataSource = new kendo.data.DataSource({
               transport: {
                   read: {
                       url: "http://localhost:3146/api/shows/wilan.bigay@clickview.com.au",
                       dataType: "jsonp",
                       contentType: "application/json; charset=utf-8",
                       data: {
                           q: "javascript"
                       }
                   }
               }
           });
           function mobileListViewDataBindInitFlat() {
               $("#result").kendoMobileListView({
                   dataSource: showDataSource,
                   template: $("#showtemp").text(),
               })
           }
            
           $('.show').live('click',function(){
               var progID = $(this).attr('data-show');
               var dataURL = 'http://localhost:3146/api/shows/wilan.bigay@clickview.com.au/data/' + progID
           });
            
           //Alerts ListView
           var dataDataSource = new kendo.data.DataSource({
               transport: {
                   read: {
                       url: dataURL , //"http://localhost:3146/api/shows/wilan.bigay@clickview.com.au/data/0000000",<- how it should look like taking the 'data-show' attribute at the end of the URL
                       dataType: "jsonp",
                       contentType: "application/json; charset=utf-8",
                       data: {
                           q: "javascript"
                       }
                   }
               }
               });
            
           function mobileListViewint() {
               $("#datashow").kendoMobileListView({
                   dataSource: dataDataSource,
                   click: function(e) {
                       //dataURL = e.dataItem.data-show;
                       console.log(e.dataItem.title);
                   },
                   template: $("#datatemp").text(),
               })
           }
 
     </script>

Sam
Top achievements
Rank 1
 answered on 10 Dec 2012
4 answers
1.3K+ views
I’m trying to load a tree from a JSON string which is being returned from a Java action instead of having it statically inside the HTML.


The original code was like so:

<script>
    $("#treeview-left, #treeview-right").kendoTreeView({
        dragAndDrop: true,
            dataSource: [
                { text: "Item 1", expanded: true, items: [
                    { text: "Item 1.1" },
                    { text: "Item 1.2" },
                    { text: "Item 1.3" }
                ] },
                { text: "Item 2", items: [
                    { text: "Item 2.1" },
                    { text: "Item 2.2" },
                    { text: "Item 2.3" }
                ] },
                { text: "Item 3" }
                        ]
    }).data("kendoTreeView");
</script>



I modified it like so:

<script>
    $("#treeview-left, #treeview-right").kendoTreeView({
        dragAndDrop: true,
            dataSource: {
                transport: {
                    read: {
                        url: "/site/GetTreeData.action",
                        dataType: "json"
                    }
                }
            }
    }).data("kendoTreeView");
</script>



The GetTreeData.action returns the following JSON string:

[
{ text: "Item 1", expanded: true, items: [
    { text: "<a href='http://localhost:8080/site/GetEmployee.action'>clear here</a>", encoded: false },
    { text: "Item 1.2" },
    { text: "Item 1.3" }
] },
{ text: "Item 2", items: [
    { text: "Item 2.1", items: [
        { text: "Item 2.1.1" },
        { text: "Item 2.1.2" }
    ] },
    { text: "Item 2.2" },
    { text: "Item 2.3" }
] },
{ text: "Item 3" }
]

If I paste the previous JSON string inside the page and reload it, the tree displays just fine.

So, what am I doing wrong?

Hari
Top achievements
Rank 1
 answered on 10 Dec 2012
3 answers
364 views
Hello,
I've been reading the existing documentation about the Treeview as well as the Hierarchical Data Source and the Data Source but I kinda lost it about the possible remote data source types that I can use with the Treeview.
Apart from json,xml is also supported right?Is it possible to bind it and view the xml file with the Treeview?
I've been trying something like:

<title>Tree View</title>
     
<link href="shared/styles/examples-offline.css" rel="stylesheet">
<link href="styles/kendo.common.min.css" rel="stylesheet">
<link href="styles/kendo.blueopal.min.css" rel="stylesheet">
 
<script src="js/jquery.min.js"></script>
<script src="js/kendo.web.min.js"></script>
<script src="shared/js/console.js"></script>
 
</head>
<body>
        <div id="example" class="k-content">
        <div id="treeview" class="demo-section"></div>
 
            <script>
                var ds = new kendo.data.DataSource({
                        transport: {
                            read: {
                                url:"http://localhost:8080/OnTheSpotRestfullAPI/testTree.xml"
                            }
                        },
                        schema: {
                            type: "xml",
                            data: "/tree/vehicles",
                            model: {
                                fields: {
                                    car: "car/text()",
                                    bike: "bike/text()"
                                }
                            }
                        }
                    });
 
                $("#treeview").kendoTreeView({
                    dataSource: ds
                });
            </script>
 
            <style scoped>
                #example {
                    text-align: center;
                }
 
                .demo-section {
                    display: inline-block;
                    vertical-align: top;
                    width: 320px;
                    height: 300px;
                    text-align: left;
                    margin: 0 2em;
                }
            </style>
        </div>
 
 
</body>
</html>

with the testTree.xml being:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<tree>
    <vehicles>
        <car>FM-1100</car>
        <car>FM-4200</car>
        <bike>FM-3100</bike>
    </vehicles>
    <personnel>
        <client>GH-3000</client>
        <vip>GH-3100</vip>
    </personnel>
</tree>

but I can't seem to be able to view the tree at all..kinda lost here,can someone please point me to the right direction?

Thanks in advance
Hari
Top achievements
Rank 1
 answered on 10 Dec 2012
5 answers
172 views
To reproduce:
  1. Take the sample at http://demos.kendoui.com/mobile/actionsheet/index.html
  2. Modify to call the same event handler
<ul data-role="actionsheet" id="inboxActions" data-open="onOpen" data-popup='{"direction": "left"}'>
    <li class="km-actionsheet-title">Monday Meeting:</li>
    <li><a href="#" data-action="reply">Reply</a></li>
    <li><a href="#" data-action="replyAll">Reply All</a></li>
    <li><a href="#" data-action="archive">Archive</a></li>
</ul>

becomes

<ul data-role="actionsheet" id="inboxActions" data-open="onOpen" data-popup='{"direction": "left"}'>
    <li class="km-actionsheet-title">Monday Meeting:</li>
    <li><a href="#" data-action="singleEventHandler">Reply</a></li>
    <li><a href="#" data-action="singleEventHandler">Reply All</a></li>
    <li><a href="#" data-action="singleEventHandler">Archive</a></li>
</ul>

Then try implementing singleEventHandler as below:

function singleEventHandler(e) {
    if (<some test involving e>) {
        $("#actionResult").html("Replying to message #" + e.context);
    } else if (<some other test involving e>) {
        $("#actionResult").html("Replying to all in message #" + e.context);
    } else if (<some other test involving e>) {
        $("#actionResult").html("Archiving message #" + e.context);
    }
     doMoreStuff();
}

The problem is e only has two properties: target and context

target is not the button which has triggered the event but the button which has opened the action sheet, so there is no way to know which button in the action sheet has been triggered in the event handler.

If not a bug, this is in my opinion a design issue which prevents properly factoring code as the only workaround is to multiply event handlers when it is not always necessary.
Iliana Dyankova
Telerik team
 answered on 10 Dec 2012
1 answer
68 views
Here is a snippet:
columns.Bound(p => p.URL).Title("Url").Visible(false);
columns.Template(p => p.TRACKINGNUMBER).ClientTemplate(
    "<a href='#= URL #'>#= TRACKINGNUMBER #</a>"
    ).Title("Tracking Number");
The above above client template ignores the URL value and simply displays the tracking number has a regular text field.




Atanas Korchev
Telerik team
 answered on 10 Dec 2012
1 answer
291 views
Inside an MVVM bound template, how do I get access to the data item itself?

This doesn't give it to me (clearly eh) :)

<li data-bind="invisible: #= console.log(this) #">
    <span>test</span>
</li>
Petur Subev
Telerik team
 answered on 10 Dec 2012
2 answers
170 views
Hi, I am new here and i have question, I need a help?

I have jQuery Dialog form with tabs.
Inside this tab i want to have Kendo UI Editor but i have this problem when do this, Inside the tab, a kendo editor creates itself 2 times.

<div id="dialog">
<div id="tabs-7" style="height:540px; width:680px;">
                        @(Html.Kendo().Editor()
                          .Name("Editor")
                          .HtmlAttributes(new { style = "width: 500px;height:440px" })
                          .Value(@<text>
                                <p>
                                       Some text
                                </p>
                                 </text>))
                    </div> 
</div>
$("#dialog").dialog( ........);

Thanks,
Milan
                                 
Milan
Top achievements
Rank 1
 answered on 10 Dec 2012
1 answer
176 views
The calendar has a selected dates collection.  Is there an MVC example of binding to this collection.  I wan to be able to display selected dates allow uses to change the selected dates then save these changes back to the database,
Georgi Krustev
Telerik team
 answered on 10 Dec 2012
5 answers
2.6K+ views
So frustrating.

I have a scenario not extremely complicated in which i require items in my drop-down actually be databound before selecting a default item.

So when does this databound event actually run? Inside my databound event handler i am checking the count of items in the dropdownlist and it is ZERO.

I have been trying to track down phantom errors which are a result of either this bug or a misunderstanding of the docs for 2 weeks. Can someone from telerik expand on this? from the telerik api:

dataBound

Fires when the drop-down list has received data from the data source.

Example

$("#dropdownlist").kendoDropDownList({
    dataBound: function(e) {
        // handle event
    }
});

To set after initialization

// get a reference to the dropdown list
var dropdownlist = $("#dropdownlist").data("kendoDropDownList");
// bind to the close event
dropdownlist.bind("dataBound", function(e) {
    // handle event
});


Have i misread "receive" data to mean received and bound the data? When really it's not databound? If so it would be extremely useful to have an actual databound event for the dropdownlist that was fired AFTER the items have been created.
Georgi Krustev
Telerik team
 answered on 10 Dec 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
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
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
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?