Telerik Forums
Kendo UI for jQuery Forum
1 answer
59 views

I'm trying to loop through some widgets by class ID to add some additional configuration.  Suppose I have the mark up below with the following script . . . how do I get widgets by class?

<input id="afCity1" name="City1" data-bind="value: dataEntryItem.City1" class="afCityDropDown" />
 <input id="afCity2" name="City2" data-bind="value: dataEntryItem.City2" class="afCityDropDown" />
 <input id="afCity3" name="City3" data-bind="value: dataEntryItem.City3" class="afCityDropDown" />
<input id="afState1" name="State1" data-bind="value: dataEntryItem.State1" class="afStateDropDown" /> 
<input id="afState2" name="State2" data-bind="value: dataEntryItem.State2" class="afStateDropDown" />

. . .
// this works no problem
$(".afCityDropDown").kendoDropDownList({
optionLabel: " ",
height: 150,
autoBind: false
});

. . .
 $(".afCityDropDown").each(function () {
 // this doesn't work
 $(this).data("kendoDropDownList").setDataSource(dataReturned);
});
Kiril Nikolov
Telerik team
 answered on 25 Sep 2013
1 answer
105 views
I am trying to populate the calendar control with the following information

List of dates that I have pulled back from the database, and with each date there is a set of events or text that I want to display. So it could be something like this.


1. 9/23/2013
     Office Visits
     Labs


2. 9/30/2013
     Office Visits


3. 10/3/2013
     Labs

And so on, and for each of these dates, I want to give the ability for the user to click on it and bring it to the page that I have associated with that date. I am doing this all through MVC, no client code for this time round, so I have everything coming back the way I want. Just not seeing how I can populate the calendar the way I want.

Vladimir Iliev
Telerik team
 answered on 25 Sep 2013
9 answers
187 views
Hi,

I would like to know how to make the controls become inactive when the drawer is displayed.

e.g. Currently, if I have a list view showing links to other pages, if I trigger the drawer to appear, I cannot press on the original list view to just hide the view.
The other pages would be displayed instead.

Thanks!
Petyo
Telerik team
 answered on 25 Sep 2013
1 answer
235 views
At first,My grid is defined like this,I click the search buttton and then the grid read the  data and group by class.
  @(Html.Kendo().Grid<Student>()
                .Name("StudentGrid")
                .Scrollable()
                .Columns(columns =>
                {
          columns.Bound(o => o.Class).Groupable(true).Title("Class");                  
       columns.Bound(o => o.Name).Groupable(true).Title("Name");
                    columns.Bound(o => o.Point).Groupable(true).Title("Point");
         
                }).AutoBind(false)
                 .DataSource(dataSource => dataSource
                                    .Ajax().Group(i => i.Add(a => a.Class))
                                    .Read(read => read.Action("GetStudentPoint", "StudentControl"))
                         .Events(events => events.Error("error_handler"))
           ))
Now I want to make the gird groupable false and hide the class column,meas I do not want to group the student data and hide class column ,What's wrong with my code?
 $("#StudentGrid").data("kendoGrid").Groupable( false );
$("#StudentGrid").data("kendoGrid").hideColumn(0);
 $("#StudentGrid").data("kendoGrid").dataSource.read();
Atanas Korchev
Telerik team
 answered on 25 Sep 2013
1 answer
115 views
I am attempting to use a nested template, as detailed here : http://www.kendoui.com/forums/kendo-ui-framework/mvvm/knockout-2-inline-foreach-template.aspx#ihuL5TyNlkKcz9Znzm1gvA

With the following code.

<article>
    <div id="steps" data-template="steps-template" data-bind="source: Steps"></div>
</article>
 
<script id="mutations-template" type="text/x-kendo-template">
     <li data-bind="text: Aspect.Name"></li>
</script>
<script id="steps-template" type="text/x-kendo-template">
    <div data-id="${Id}">
        <h2 data-bind="text: Name"></h2>
        <div><ol data-bind="source: Mutations" data-template="mutations-template"></ol></div>
        <input class="autocomplete" data-key="${Id}" id="autocomplete-${Id}" />
    </div>
</script>
Within my autocomplete, there is code to add the selected data to the current items "Mutations" observable array.

This works okay, it adds the data (I can see it with javascript inspection), but the nested template does not update. Is there anything else I can do about this?
Alexander Popov
Telerik team
 answered on 25 Sep 2013
1 answer
47 views
Hy Everyone

We are interested in migrating from jquery.mobile to kendoUI mobile. 
We are using thorax (https://github.com/walmartlabs/thorax) and we only want to use kendo ui mobile for the ui bot not for the routing. 

Is it possible to use a different routing (like Backbone, Knockout etc.) with kendo ui mobile or not? Exists any example how kendo ui mobile can be used with any of those frameworks (I know there is a backbone blog post for kendo ui, but not for kendo ui mobile). 

Thanks a lot

Petyo
Telerik team
 answered on 25 Sep 2013
4 answers
146 views
Hi - we are looking for the possibilities to see and use the Kendo UI..

how to define the Custom Template here


@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Screening>()
.Name("scheduler")
.Date(new DateTime(2013, 6, 13))
.StartTime(new DateTime(2013, 6, 13, 10, 00, 00))
.EndTime(new DateTime(2013, 6, 13, 23, 00, 00))
.Height(600)
.AllDayEventTemplateId("customAllDayTemplate")
.Views(views =>
{
views.DayView();
views.AgendaView();
})
.BindTo(Model)
)
Vladimir Iliev
Telerik team
 answered on 25 Sep 2013
5 answers
211 views
Hi,

I am building a test rails/kendo mobile application which have three main models: Organizations, Shops and Categories.
The shop model has latitude and longitude among its attributes. This is because I would like to show a map on the Shop details view with a marker where the shop is. The first time I view a random shop, the code works fine, and the map renders with the marker. But when I click the back button (browser back button) or the Shops link (in tabstrip) then try to navigate to another shop the map won't show up only if I hit refresh on the browser.

First I thought that this happens because of the changing coordinates (which are placed directly inside the javascript like this: .LatLng(<%=@shop.latitude%>, <%=@shop.longitude%>) ). But no. Even with a simple map like this it won't show up from the second shop view:
       function shopMap(e) {
            var myOptions = {
                center: new google.maps.LatLng(-34.397, 150.644),
                zoom: 8,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };

            var mapElement = $("#shopmap");
            var container = e.view.content;

            var map = new google.maps.Map(mapElement[0], myOptions);
        }

I tried to place the above code directly inside the the view where the shop data is rendered, which would be my preferred way of doing this to be able to change the coordinates dynamically from db, but also tried to place the code in application.html.erb, but no effect (to mimic the google maps example in the code library).

I tried to init the map with the following data attributes:
data-init
data-before-show
data-show

Also tried to set:
data-reload="true"

but none of them and none of their combinations seems to work.

Here is the code for the shop view:
<div data-role="view" data-layout="default" data-show="shopMap" data-reload="true" data-init="shopMap" data-after-show="shopMap" data-title="<%= @shop.title %>" data-zoom="true">
    <h1 id="shoptitle"><%= @shop.title %></h1>
    <%= image_tag(@shop.logo.thumb.url) %>
    <p><%= @shop.description.html_safe %></p>
    <p id="latitude"><%= @shop.latitude %></p>
    <p id="longitude"><%= @shop.longitude %></p>
    <div id="shopmap">
        
    </div>
    <script>
        function shopMap() {
            var myOptions = {
                center: new google.maps.LatLng(<%= @shop.latitude %>, <%= @shop.longitude %>),
                zoom: 8,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };

            var mapElement = $("#shopmap");
            var container = e.view.content;

            var map = new google.maps.Map(mapElement[0], myOptions);
        }  
    </script>
</div>

The reason why I gave ids to the p tags which contain the latitude and longitude is that I tried to place their values inside js variables to pass them to the shopMap function. But that doesn't work either.

I also tried the kendoMap plugin. But it doesn't work either with the basic settings.

My end goal is to make the map appear without page refresh with the marker which belongs to the currently viewed shop.

Please give me some suggestions, pointers to make this happen!

Best Wishes,
Matt
Petyo
Telerik team
 answered on 25 Sep 2013
1 answer
201 views
Hi
I have 2 dropdown in the edit template.

<input id="1" style="width: 300px" />
<input id="2" disabled="disabled" style="width: 300px" />

on selection of 1st dropdown , I fill 2nd dropdown (using cascading e.g.) ,  for some values in the 1st  dropdown I need to show textbox in place of 2nd dropdown as a result.

How to achieve this?

Nikolay Rusev
Telerik team
 answered on 25 Sep 2013
1 answer
42 views
On http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/mobilelayout/overview#example---get-reference-to-a-kendo-ui-mobilelayout-instance , you should notice that the jQuery call to:
$("#Mobilelayout")
is not using the correct id of the Layout element, which is "MobileLayout".

Kiril Nikolov
Telerik team
 answered on 25 Sep 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?