Telerik Forums
Kendo UI for jQuery Forum
1 answer
294 views
Hi, I have been working on a project where we have to generate the columns dynamically depending on the data coming from Server. We are using Kendo JSP taglib, so using java scriptlet to iterate over the list passed as model attribute to the JSP. Code snippet is as following:

 
<kendo:grid-columns>
     <% 
     
     List fieldsList =  (ArrayList)request.getAttribute("columnArr"); 
     List columnsList = (ArrayList)request.getAttribute("fieldsArr");
     String colName = "";
     String fieldName = "";
     for(int i=0;i<columnsList.size();i++){
      colName = columnsList.get(i);
      fieldName = fieldsList.get(i);
      System.out.println("Col and Field values are:::"+colName+","+fieldName);
      %>          
      <kendo:grid-column title="<%=colName %>"
       field="<%=fieldName %>" headerAttributes="style=\"overflow: visible; white-space: normal;font-weight: bold;\""  />
     <%} %>         
       
     </kendo:grid-columns>

Above code works fine if I use hard coded values in title and field attributes. but when I use variables as shown in above snippet, I get the following exception at runtime:
org.apache.jasper.JasperException: /WEB-INF/views/dashboardWidget.jsp(37,6) Unknown attribute type (String) for attribute title.
 at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
 at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
 at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
 at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1164)
 at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:821)
 at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
 at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
 at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)

Any idea why Title and field attribute are not accepting String variable as value? I have seen the Tag lib for Kendo:grid-column, title has type as String.
<attribute>
            <description>The text that is displayed in the column header cell. If not set the field is used.</description>
            <name>title</name>
            <rtexprvalue>true</rtexprvalue>
            <type>String</type>
        </attribute>
Please also let me know if there is some other way to generate columns dynamically without using scriptlet.
Thanks & Regards,
Preeti

Nikolay Rusev
Telerik team
 answered on 27 Aug 2013
2 answers
227 views
I want to group my scheduler by locations and I'm trying to do so by binding my resources to a datasource. But I can't seem to get it to work (the commented out example - where I use a hardcoded example works fine).

@(Html.Kendo().Scheduler<NFFO_MVC4.Models.BookingViewModel>()
    .Name("Scheduler")
    .Date(DateTime.Today)
    .StartTime(DateTime.Today.AddHours(7))
    .EndTime(DateTime.Today.AddHours(20))
    .Height(600)
    .Width(2000)
    .Messages(message =>
        {
            message.AllDay("Hele dagen");
            message.Today("I dag");
        })
    .Timezone("Europe/Copenhagen")
    .Views(views =>
    {
        views.DayView(day => day.Title("Dag"));
        views.WeekView(week => week.DateHeaderTemplate("<span title='#=kendo.toString(date, 'dddd dd.MMM')#'>#=kendo.toString(date, 'ddd')#</span>").Title("Uge").Selected(true));
        views.MonthView(month => month.Title("MÃ¥ned"));
        views.AgendaView();
    })
        .Group(group => group.Resources("Lokationer"))
        .Resources(resource => resource.Add(m => m.LokationId)
                                    .Title("Lokation")
                                    .Name("Lokationer")
                                    .DataTextField("Navn")
                                    .DataValueField("Id")
                                    .DataSource(ds => ds.Read(read => read.Action("GetLocations", "Scheduler"))))
        //.Resources(resource => resource.Add(m => m.LokationId)
        //                                .Title("Lokation")
        //                                .Name("Lokationer")
        //                                .DataTextField("Text")
        //                                .DataValueField("Value")
        //                                .DataColorField("Color")
        //                                .BindTo(new[] {
        //                            new { Text = "Parken Stadium", Value = 1, Color = "#6eb3fa" },
        //                            new { Text = "Sportspladsen", Value = 2, Color = "#f58a8a" },}))
        .DataSource(d => d
        .Model(m => m.Id(f => f.BookingId))
        .Read("GetBookings", "Scheduler")
    )
)
EDIT: Have both tried with or without 'read => read.Action'

I am pulling the data from the following actions in the SchedulerController:
public ActionResult GetBookings([DataSourceRequest] DataSourceRequest request)
{
    IEnumerable<BookingViewModel> bookingViewModels = _db.Bookinger.Select(booking => new BookingViewModel
        {
            BookingId = booking.Id,
            LokationId = booking.Lokation.Id,
            Title = booking.Aktivitet,
            Description = booking.Aktivitet + " (" + booking.Forening + ")",
            Start = booking.Start,
            End = booking.Slut,
            IsAllDay = false
        });
 
    return Json(bookingViewModels.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
 
public ActionResult GetLocations([DataSourceRequest] DataSourceRequest request)
{
    return Json(_db.Lokationer.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
Alexander
Top achievements
Rank 1
 answered on 27 Aug 2013
4 answers
89 views
I modified the flat theme slightly as per these guidelines:

http://docs.kendoui.com/getting-started/mobile/styling

This worked perfectly, but when I added the app to my home screen (iPhone 5) the app showed the original flat theme colours.

Why would the app be different when launched from the home screen, and how can I prevent this?

Thanks.
Trent
Top achievements
Rank 1
 answered on 27 Aug 2013
2 answers
173 views
We are just trialing the Kendo package at the moment?

If so - docs/api?

Thanks
Myles.
Myles
Top achievements
Rank 1
 answered on 26 Aug 2013
0 answers
64 views


Stephen
Top achievements
Rank 1
 asked on 26 Aug 2013
1 answer
126 views
I'm binding a select like this in a listview template.

<select class="status" class="select" data-value-field="StatusName" data-text-field="Description" data-bind="events: {change: statusChangeEvent}, source: options, value: status" />

everything works fine, the selection options are bound, except when I change the selection I get an error that the object has no method 'get'.

what am I doing wrong?

thanks.

Jon
     
jon
Top achievements
Rank 1
 answered on 26 Aug 2013
2 answers
220 views
Hi,
I have been trying to use the new inline editing capability, but the editor will not take any keyboard our mouse input.  I can see the content if I manually edit the HTML or set it in js using .value(), but I cannot type or select the content with the mouse.  The HTML in the inspector looks just like the demo after calling .kendoEditor() on the JQuery object:

<div contenteditable id="editor" class="k-widget k-editor k-editor-inline k-state-active" data-role="editor">Test text</div>

It seems as though something is stealing the mouse/keyboard input, but I have disabled all other event handlers and it still does not work.  Any help you can provide is greatly appreciated.

UPDATE: It appears that the keydown and keyup events on the editor are indeed firing.

Regards,
Sam
Sam
Top achievements
Rank 1
 answered on 26 Aug 2013
2 answers
228 views
We have been noticing that the DateTime widget, by default, selects the current date and time. And obviously, the time intervals are based on this default time. But this leads to some awkward behavior. Say the time is currently 1:18pm. The intervals the user can pick from are 1:18pm, 2:18pm, and so on. It's quite strange to think of the user choosing to schedule their appointment at 2:18pm.

It would be much nicer if the intervals could be at every 00, every 15, every 30, etc. Something like that. Is that possible? I'm assuming there's no way to do this with built-in behavior, but is there another way? Thanks.
JohnVS
Top achievements
Rank 1
 answered on 26 Aug 2013
2 answers
72 views
Hi,

We have noticed that when we have the column menu enabled, there is no longer a marker on the column header to show which columns are filtered.  Is this due to be fixed, or is there a workaround?

Thanks
Dan
Cody
Top achievements
Rank 1
 answered on 26 Aug 2013
1 answer
104 views
Hi all,

I have a question about switching views. It doesn't work the way I'd expect and I'm not sure if I'm structuring my project correctly.

My assumption is that I can switch views by using the controller the way you would usually do in ASP.Net MVC. Here's my code and the URL for the start view:

URL:
http://localhost:2121/Home/MobileHomePage

Code snippet for the button:
@Html.Kendo().MobileButton().Text("Go to new view").Url("ExpenseClaimListMobile", "ExpenseClaim")

When I click the button I'd expect the URL to be:
http://localhost:2121/ExpenseClaim/ExpenseClaimListMobile

Instead it is:
http://localhost:2121/Home/MobileHomePage#/ExpenseClaim/ExpenseClaimListMobile

Is this correct? It seems to work, but when I then navigate back to the home page the URL is:
http://localhost:2121/Home/MobileHomePage#/Home/MobileHomePage
Once we get to this URL the page has problems like the buttons not working, and my assumption is that this is because the application is being created twice (calling "var app = new kendo.mobile.Application();" twice because it's in the _Layout code).

What am I doing wrong?

Thanks in advance!
Kiril Nikolov
Telerik team
 answered on 26 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?