Telerik Forums
Kendo UI for jQuery Forum
3 answers
306 views
I have a chart with multiple series (See attached).
I want to list the dates from the series available in the same data.
The problem im experiencing is selecting a category axis value. Setting it on any of the series causes all of the series to not show, but the dates do for all rows.

Json data:
01.[{
02."InStore":{"OrderCount":0,"Sales":0,"Canceled":null},
03."Collection":{"OrderCount":31,"Sales":28290,"Canceled":null},
04."Delivery":{"OrderCount":10,"Sales":15883,"Canceled":null},
05."Combined":{"OrderCount":41,"Sales":44173,"Canceled":1},
06."Date":"\/Date(1381964400000)\/"},
07.{"InStore":{"OrderCount":0,"Sales":0,"Canceled":null},"Collection":{"OrderCount":49,"Sales":31990,"Canceled":null},
08."Delivery":{"OrderCount":18,"Sales":36463,"Canceled":null}
09.
10.}]
Within this data the chart has 4 series:
Combined.OrderCount;
Collection.OrderCount;
Delivery.OrderCount;
Combined: Sales

for those series I want to use the 'Date' field.
The HTML looks like this:

01.<div class="chart-wrapper" data-role="chart"
02.                data-title="Order Details"
03.                data-theme="bootstrap"
04.                data-legend="{ position: 'bottom' }"
05.                data-series-defaults="{ type: 'line' }"
06.@*                data-category-axis="{
07.                    field: 'Date',
08.                    baseUnit: 'day',
09.                    type: 'date',
10.                    labels: {
11.                        rotation: -90
12.                    },
13.                    majorGridLines: {
14.                        visible: false
15.                    }
16.                }"*@
17.@*                data-category-axis="{
18.                    categories: [1,2,3,4,5,6,7]
19.                }"*@
20.                data-category-axis="{
21.                    labels: { rotation: -90, template: 'Hello' }
22.                }"
23.                data-value-axis="[
24.                    { name: 'orderCount', title: { text: 'Orders' } },
25.                    { name: 'sales', title: { text:'Sales' } }
26.                ]"
27.                data-tooltip="{
28.                    visible: true,
29.                    template: '<div>#: kendo.toString(dataItem.Date, \'dddd\') # #: kendo.toString(dataItem.Date, \'d\')#</div><div>Order Count:#: value #</div>'
30.                }"
31.                data-group="{field:Date}"
32.                data-series="[
33.                    { 'name': 'OrderCount', 'field': 'Combined.OrderCount', 'axis': 'orderCount' },
34.                    { 'name': 'Delivery', 'field': 'Delivery.OrderCount', 'axis':'orderCount', 'type': 'column', 'stack': 'true' },
35.                    { 'name': 'Collection', 'field': 'Collection.OrderCount', 'axis': 'orderCount', 'type': 'column', 'stack': 'true' },
36.                    { 'name': 'Sales', 'field': 'Combined.Sales', 'axis': 'sales', 'type': 'area' }
37.                ]"
38.                data-bind="source: dataSource">
39.            </div>
Any ideas? Setting the categories manually works but I don't want to do it this way as it will be more to maintain and more effort over more charts.

Additionally - why does the legend disappear after the chart gets its data?

Thanks, Matt
Matt
Top achievements
Rank 1
 answered on 30 Oct 2013
0 answers
198 views

web master
Top achievements
Rank 1
 asked on 30 Oct 2013
1 answer
183 views
I have a list view that is created using MVVM style. I am trying to use the "Press to load more" function from KendoUI mobile. I am listing all post from my Wordpress site into a list view that when clicked on it shows a detailed view of the post clicked on. I am using MVVM to accomplish this for now but i am not able to get the list view to load more post from the server using endless scrolling or Press to load more. Here is my full code on Jsbin.com Please help me.
Pavel Kolev
Telerik team
 answered on 30 Oct 2013
3 answers
102 views
I have a very silly problem.

I have a Kendo Grid with Detailed View that can expand/collapse, it works flawlessly and looks good.  The problem is that as soon as I insert a Kendo Line Chart to the page the rows in the Grid can no longer be selected, also not expanding.  I t works well without the Chart within the same page.

I´ve checked the console of Firebug and that does not display any errors.  I also can not detect any events when clicking row within the grid.  It simply will not work.

Do you have any thoughts?  Does Kendo Grid and Chart not work when used on the same page?

Thank you.
Dimiter Madjarov
Telerik team
 answered on 30 Oct 2013
1 answer
124 views
Hi,

I'm looking to use the Kendo Upload control to Import vCards onto a Contact Creation page. Since I want to return a PartialView, and populate a Div's .html attribute, I'd like to do this as a jQuery Post like I've outlined below:
@(Html.Kendo().Upload()
     .Name("vCard")
     .Async(a => a
         .Save("UploadContact", "Contacts") /*Don't really need this if I can post via jQuery */
         .AutoUpload(true)
         )
     .Events(events => events
         .Select("onSelect")
         .Upload("onUpload")
         )
     .ShowFileList(false)
     .Multiple(false)
     )
function onUpload(e) {
        var upload = $("#vCard").data("kendoUpload");
        var files = upload.files;
 
        var serialized = "vCard=" + files;
        $.post("/Contacts/UploadContact/", serialized, function (returnHtml) {
            //alert(returnHtml);
            $("#ContactContainer").html(returnHtml);
        });
My issue is that I am constantly getting a null object when posting to /Contacts/UploadContact using jQuery.

Is there any way to pass the entire file list (including FileStream) back to the controller from jQuery like I've outlined in the "onUpload" method?

Any help would be greatly appreciated.

Thanks,
Landon
Dimiter Madjarov
Telerik team
 answered on 30 Oct 2013
1 answer
105 views
I tried to upgrade from v2013.2.716  to v2013.2.918 (kendo.all.min.js) and ran into a few issues. My general question is whether there is a doc that provides more detail on the changes made, outside of the readme that just lists that a fix was applied with not much detail on how. Here are the two major issues I've seen and I've since rolled back to 716 since I don't have time to troubleshoot the issues right now.

View events:event objects always return empty objects. event.view and the other framework params are undefined in the show, init, and hide callbacks. 
Mobile Listview: I have a detailbutton in my template and there an extra icon span with the same detail icon is being added to my li. Below is my template

01.<script id="tmp-favorite" type="text/x-kendo-template">
02.       # var bool = category.toLowerCase().indexOf("documents")<0 #
03.       # var path =  !bool && ThumbnailImage && ThumbnailImage.indexOf("data:")<0?"data:image/jpeg;base64,"+data.ThumbnailImage:data.ThumbnailImage #
04.       <img src="#: path #"/>
05.               <div class="li-text">
06.                   <p class="li-title">#: t # (#: FavoriteName #)</p>
07.                   <p class="li-desc">#: FavoriteType #</p>
08.               </div>
09.           <span data-role="detailbutton" data-icon="isfavorite" class="item-favorite-status alt-btn right-1"></span>
10.       </script>

Petyo
Telerik team
 answered on 30 Oct 2013
2 answers
84 views
Helly Guys,


I have two tabstrip, but I want the first one to always appear as active. Here is the excerpt of the code below (that doesn't work).

    <!-- FOOTER -->
    <div data-role="footer" data-align="left">
        <div data-role="tabstrip" data-align="left">
            <a href="#results" data-icon="globe" data-transition="slide:top" id="resultstab"><div id="results_count_display" style="color:white" class="km-text">Loading..</div></a>
            <a href="#filter" data-icon="settings" data-transition="slide:top" id="settingstab"><div class="km-text" style="color:white">Filter</div></a>
        </div>
    </div
    <!-- END OF: FOOTER -->
<script>
$('#settingstab').bind('click', function () { $('#settingstab').removeClass('km-state-active');$('#resultstab').addClass('km-state-active'); });   
</script>
</div>
I want that when "settingstab" is clicked on: the "resultstab" flips back to active.


Thanks.
Chris @ Willows Consulting Ltd.
Top achievements
Rank 1
 answered on 30 Oct 2013
1 answer
91 views
Using the Menu in IE9, the child menu items are hidden behind the flash object.  When viewing the page in Chrome, the child menus are shown correctly.  Any suggestions on getting this to work?

<div id="header" ></div>
<div id="main-nav" >
    <div class="container_16">
       <ul id="menu">
      <li><a href=".">Funds</a>
       <ul>
        <li><a href=".">Fund Defination</a></li>
        <li><a href=".">Fund Portfolio Datamart</a></li>
       </ul>
      </li>       
      <li><a href="">Partners</a><ul>
        <li><a href=".">Distribution Dashboard</a></li>
        <li><a href=".">Mailing Lists</a></li>
        <li><a href=".">Contact Password Lookup</a></li>
       </ul>
      </li>
      <li><a href=".">Portfolio</a></li>
      <li><a href=".">Supplemental</a></li>
      <li><a href=".">My Reports</a></li>
      <li><a href="">Utilities</a></li>      
     </ul>
</div>    
   </div>
   <div id="site-content">
    <div class="container_16">
     <div id="flashContent">
       <a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" title="Get Adobe Flash player" /></a><br />
       You need <a href="Flash'>http://www.adobe.com/go/getflashplayer">Flash Player 8</a> and allow javascript to see the content of this site..
     </div> 
    </div>
   </div>
Dimo
Telerik team
 answered on 30 Oct 2013
2 answers
194 views
Hello,

I am trying to get working hierarchical datasource with MVVM. My data could be described like this: there are documents, documents have sections, sections have questions. By clicking on document I want to fetch sections data of that document, and by clicking on section, I want to fetch questions data of that section. After data is fetched, I want my views to be updated automatically thanks to MVVM.

This is how I descripe hierarchical datasources in code:

var questionsDataSource = {
transport: {
read: {
url: "questions",
dataType: "json"
}
},
schema: {
data: "questions",
model: {
id: 'ID',
hasChildren: false
}
},
change: function(e){
var rootModel = this.parent().parent().parent();
this.parent().parent().parent().set("questions", this.view()); // if I manually set data here, the ordering works
},
sort: {
field: 'order',
dir: 'asc'
}
};

var sectionsDataSource = {
transport: {
read: {
url: "sections",
dataType: "json"
}
},
schema: {
data: "sections",
model: {
id: 'ID',
children: questionsDataSource,
hasChildren: 'hasChildren',
}
},
change: function(e){
var rootModel = this.parent().parent().parent();
this.parent().parent().parent().set("sections", this.data()); // here I assign active sections that would be shown in view
},
};

var documentsDataSource = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "documents",
dataType: "json"
}
},
schema: {
data: "documents",
model: {
id: "ID",
hasChildren: true,
children: sectionsDataSource
}
},
change: function(e){
this.parent().set("documents", this.view());
},
sort: {
field: 'ID',
dir: 'asc'
},
});


var viewModel = kendo.observable({

dataSource: documentsDataSource,

documents: [],

sections: [],

questions: [],

// other data and methods

});


kendo.bind($("#view-model"), viewModel);

documentsDataSource.fetch(function () {
// load first document
// var node = documentsDataSource.at(0); // sorting does not work
var node = documentsDataSource.view()[0]; // sorting works

// load sections
node.load();
});

I have much more code but for the beginning tmabe that'll be enough.

First question - is such nesting of datasources the right way?

Second question: how in view to show the sections that was lastly loaded, that means, active sections? What I do now is on sections dataSource change event asign this.view() data to additional "sections" property in kendo.observable({}) model and bind my view to this property. But thats feel like additional job, as using MVVM changes in datasource should directly reflect in view. Is there a better way?

Third question: when questions data is fetched, it is not sorted by "order" property. Only if I manually set "questions" to be equal to this.view() on change event in questionDataSource, it gets ordered. So MVVM gets no meaning if I need to manually update my data on change event. What am I doing wrong?
P
Top achievements
Rank 1
 answered on 30 Oct 2013
2 answers
176 views
I can't bring window to front by touching neither titlebar, nor content area
http://jsfiddle.net/YreX4/
We are still on 2012.3.1114 (an upgrade requires long scrupulous testing)
Same behaviour on android (4.0) and iOS5
On desktop you can see this in latest Chrome by enabling "emulate touch events" in developer tools.

Is it a bug? Are there any workarounds?
Dimo
Telerik team
 answered on 30 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?