Telerik Forums
Kendo UI for jQuery Forum
7 answers
151 views
Here is my function to open the window, but I am get the following error;

Cannot read property 'field' of undefined

How do I use the data items on the loaded page?

function showEdit(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
editWindow.refresh({url:"/Managers/ratesheet_edit.aspx",data: dataItem});
$("#editRateSheet").closest(".k-window").css({
top: 10,
left: 10
});
editWindow.open();
}
Alexander Valchev
Telerik team
 answered on 23 Aug 2013
2 answers
323 views
How do you link between two views in a MVC mobile application while maintaining a layout? The code for my _Layout.mobile file is below:
<body>
    @if (IsSectionDefined("head"))
    {
        @RenderSection("head", false);
    }
 
    @RenderBody()
 
    @(Html.Kendo().MobileLayout()
        .Name("mainLayout")
        .Footer(@<text>
            @(Html.Kendo().MobileTabStrip()
                .Name("tabStrip")
                .SelectedIndex(7)
                .Items(items =>
                    {
                        items.Add()
                            .Text("Home")
                            .Icon("home")
                            .Url("Index", "Club", new { club = Model.CurrentContext.Club.FriendlyName })
                            .Target("_top");
                        items.Add()
                            .Text("Browse")
                            .Icon("search")
                            .Url("Browse", "Club", new { club = Model.CurrentContext.Club.FriendlyName })
                            .Target("_top");
                        items.Add()
                            .Text("More")
                            .Icon("more")
                            .Rel(MobileButtonRel.Drawer)
                            .Url("#moreDrawer")
                            .Target("_top");
                    })
            )
        </text>)
    )
 
    @(Html.Kendo().MobileApplication()
        .ServerNavigation(false)
        .PushState(true)
        .HideAddressBar(true)
        .Layout("mainLayout")
        .Transition("slide")
    )
 
    @(Html.Kendo().MobileDrawer()
        .Name("moreDrawer")
        .Views()
        .HtmlAttributes(new { style = "width:200px" })
        .Content(obj =>
            Html.Kendo().MobileListView().Type("group")
                .Items(root => {
                    root.Add().Text("Links").Items(items =>
                    {
                        items.Add().Icon("home").Content(@<text>
                            @Html.ActionLink("Home", "Index", "Club", new { club = Model.CurrentContext.Club.FriendlyName }, new { })
                        </text>);
                        items.Add().Icon("search").Content(@<text>
                            @(Html.Kendo().MobileButton()
                                .Text("Browse")
                                .Url("Browse", "Club", new { club = Model.CurrentContext.Club.FriendlyName })
                            )
                        </text>);
                        if (Model.CurrentContext.Club.BuddyListEnabled)
                        {
                            items.Add().Icon("share").Content(@<text>
                                @(Html.Kendo().MobileButton()
                                    .Text(Model.CurrentContext.Club.BuddyListPluralName)
                                    .Url("Buddies", "ClubProfile", new { club = Model.CurrentContext.Club.FriendlyName })
                                )
                            </text>);
                        }       
                    });
 
                    root.Add().Items(items =>
                    {
                        items.Add().Icon("contacts").Content(@<text>
                            @(Html.Kendo().MobileButton()
                                .Text("Sign Up")
                                .Url("SignUp", "Club", new { club = Model.CurrentContext.Club.FriendlyName })
                            )
                        </text>);
                        items.Add().Icon("@Url.Content('~/Content/Images/Lock32White.png')").Content(@<text>
                            @(Html.Kendo().MobileButton()
                                .Text("Log In")
                                .Url("LogIn", "Club", new { club = Model.CurrentContext.Club.FriendlyName })
                            )
                        </text>);
                    });
                })
            )
        )
</body>

I can move around my application just fine by using mobile buttons with the following code:
@(Html.Kendo().MobileButton()
                .Text("Sign Up")
                .Url("SignUp", "Club", new { club = Model.CurrentContext.Club.FriendlyName })
            )
However, I would like to do the same thing using a href. Is this possible or do I need to change the css of the button to accomplish what I would like?
Kelly
Top achievements
Rank 1
 answered on 23 Aug 2013
3 answers
69 views
I have just spent a few hours debugging some kendodatasources, but have now narrowed it down to a bug in kendo mvvm bindings (I think).

For example in the html below I have data-bind="source:viewModel.orderSource", where orderSource is a kendodatasource object in the viewModel.

Notice in the commented out html I just reference client name on the main entity with #: ClientName#.

Well I then added a Client entity to the data model and made that a reference on the main Order entity.

But, everytime I ran the code I was getting "Uncaught ReferenceError: ClientName is not defined".

After trying lots of things (thinking it was my odata source or kendodatasource definition) that was causing the problem I change ClientName in the commented out section to Client.ClientName in an act of desperation!

Voila!  The error was fixed.

So the issue must be that the MVVM bindings somehow don't recognise that the "#: " is within a comment and tries to bind it.

Is that a bug or is that somehow strangely by design?

What made it all the more difficult is that the error occurred at the datasource.read(), and didn't mention anything about the binding level being the issue.

***Just realised I should have probably posted this on the Kendo forums, but may as well leave here in case anyone hits the same issue.****

<div>
<ul data-role="listview" data-auto-bind="false" data-style="inset" data-bind="source:viewModel.orderSource,events:{click:selectorder}" data-template="ordersTemplate">

            </ul> 
        </div>

        <script id="ordersTemplate" type="text/x-kendo-template">
            <a href="\#side-order?orderID=#: EnquiryId #" >
               <!-- <span data-bind="style: {
        backgroundColor: Status.StatusColor}" class="statusBadge">#: Status.StatusName# </span><span style="font-size:11px">#: ClientName# #: MainAddress1# #: MainPostcode#</span>-->
             <span ></span><span data-bind="attr: { class: Status.StatusCssClass}" style="font-size:11px">#: Client.ClientName# #: Client.ClientAddress# #: Client.ClientPostcode# (#:Status.StatusName#)</span>
                
            </a> 
        </script>
Petur Subev
Telerik team
 answered on 23 Aug 2013
1 answer
40 views
When i use the flat theme the drawer shows just fine but when i close it, it overlays on top of the main view.
can someone tell me why and how to fix it.

thanks!!
Alexander Valchev
Telerik team
 answered on 23 Aug 2013
2 answers
85 views
Just so you guys know, on the demo site at http://demos.kendoui.com/mobile/modalview/index.html , there is a misspelling in the ASP.NET MVC index.cshtml example, where the template helper is named "ModalViewContentTempalte".
Kiril Nikolov
Telerik team
 answered on 23 Aug 2013
2 answers
75 views
The problem is that when using a custom validation in the Kendo UI Grid for with a single editable column in IE 9 and 10 the validation message seems to get duplicated for the following use-case,

Please refer to the following JSFiddle - http://jsfiddle.net/praneethw/j9D8Q/2/

1. Wait for the grid to load.
2. Click on the editable column "Allocated"
3. Delete the content.
4. Click on a different row.
5. Click back in the Textbox and notice the duplicate warning message.

I need to enable a few custom validations and this seems to be blocking me at the moment when using with IE
I would greatly appreciate you quick response please with a resolution or work around please.
Praneeth
Top achievements
Rank 1
 answered on 23 Aug 2013
3 answers
85 views
When I sort the grid, I see this error





extend.getterkendo.web.js:2326
Comparer.selectorkendo.web.js:6528
Comparer.comparekendo.web.js:6532
Comparer.createkendo.web.js:6558
Query.sortkendo.web.js:6965
Query.processkendo.web.js:7194
Observable.extend.querykendo.web.js:8456
Observable.extend._querykendo.web.js:8501
Observable.extend.sortkendo.web.js:8581
Widget.extend._click


This error doesn't happen on all the columns. Its only on some columns. 
Alexander Popov
Telerik team
 answered on 23 Aug 2013
1 answer
54 views
Hi,

On the Radar Area Chart demo that exists on the KendoUI Website you can see that the highlighted areas are covering the Grid, so the grid lines are not really visible. As more areas are stacked on top of each other the grid lines dissapear. The grid is probably rendered underneath the highlighted areas. Is there a way to get the grid to render on top of the highlighted areas so that the grid lines are still / always visible?

Thanks in advance for any help on this one.

Marcel
Hristo Germanov
Telerik team
 answered on 23 Aug 2013
1 answer
237 views
In the folowing I am trying to render the output of an action to the grid using MVC 4:

     .ToolBar(t=>t.Template(@<text>
             @Html.RenderAction("DisplayAccountDropDown", "ClientAccountState");
             <button class="k-button" id="clearFilter">Clear</button>
             <a class="k-button" href="@Url.Action("Export", "Holdings")" >Export</a>
          </text>))


But the Html.RenderAction doesn't have a return value to render so throws an error. Is there a way to get the output of the action into the toolbar? I am converting an app to use Kendo so would rather not have to change the controller if possible.
Rosen
Telerik team
 answered on 23 Aug 2013
3 answers
214 views
Is it possible to build a Chart in the MVC Control and pass it to the View in the Model?  I want to do this so that I can dynamically display a chart based on the desired dashboard layout.  So I want the View to dictate where the charts are displayed but I want the View to be ignorant of the reports content.  Let me know if I haven't explained what I want to do well enough or if there is a better way.  I plan to have the dashboard layouts and which reports those contain stored in a database.

This is a "mark up"
View
@model ChartCollection
@{
    ViewBag.Title = "Dashboard";
}
<h2>
    Dashboard
</h2>
@Html.Partial("_Report1", Model["ValidationResults"])
@Html.Partial("_Report2", Model["ClientComponents"])

ChartCollection(Model)
public class ChartCollection : Dictionary<string, IChart>
{
}
Controller
01.public class HomeController : Controller
02.{
03.    public ActionResult Index()
04.    {
05.        ViewBag.Message = "Welcome to ASP.NET MVC!";
06. 
07.        return View();
08.    }
09. 
10.    public ActionResult About()
11.    {
12.        ChartCollection charts = new ChartCollection();
13. 
14.        IChart chart;
15. 
16.        /// How do I duplicate this logic in the Controller?
17.         @(Html.Kendo().Chart()
18.            .Name("ClientComponents")
19.            .Title("Components")
20.            .DataSource(ds =>
21.                    {
22.                        ds.Model(model =>
23.            {
24.                            foreach (DataColumn col in Model.QueryResults.Columns)
25.                            {
26.                                model.Field(col.ColumnName, col.DataType);
27.                            }
28.                        });
29.                    }
30.            )
31.        .Legend(legend => legend.Visible(true).Position(ChartLegendPosition.Bottom))
32.        .Series(series => series.Bar(new int[] {2,4,6}).Name("MyValues"))
33.        .CategoryAxis(yaxis => yaxis.Categories(new string[] {"Hello", "World"}))
34.        .Tooltip(tip => tip.Visible(true)) )
35. 
36.        /// Add the IChart to the ChartCollection
37.        charts.Add(chart.Name, chart)
38.        return View(charts);
39.                }
40.            }
T. Tsonev
Telerik team
 answered on 23 Aug 2013
Narrow your results
Selected tags
Tags
+? 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?