Telerik Forums
Kendo UI for jQuery Forum
1 answer
341 views
Hello,
I'm developing a mobile application that contains a scrollview within a PDF document renders with PDF.js (Mozilla).

The problem is that the scrollview does not allow us to scroll down and we can only see a part of the pdf file.

Here is a sample project to show the problem : http://www.mediafire.com/?9md21u9zy56dwkd

Any idea ?
Thank's in advance,
Petyo
Telerik team
 answered on 14 Dec 2012
1 answer
189 views
I have a nested ViewModel structure, with a custom editor on the grid that can edit the List of 'Items' on the QuestionLifeCycleAssignmentViewModel.

Here is the ViewModel:
public class AssignedQuestionViewModel
{
    public int QuestionTemplateId { get; set; }
    public int QuestionGroupTemplateId { get; set; }
    public string QuestionText { get; set; }
    public bool Required { get; set; }
    public string RequiredCheckedString { get; set; }
    public QuestionLifeCycleAssignmentViewModel LifeCycle { get; set; }
}
 
public class QuestionLifeCycleAssignmentViewModel
{
    public List<QuestionLifeCycleAssignmentItemViewModel> Items { get; set; }
    public string SelectedLifeCycleCsvList { get; set; }
}
 
public class QuestionLifeCycleAssignmentItemViewModel
{
    public string LifeCycleDescription { get; set; }
    public int LifeCycleId { get; set; }
    public bool Assigned { get; set; }
    public string LifeCycleAbbreviation { get; set; }
 
}

Here is the View:
@(Html.Kendo().Grid<AssignedQuestionViewModel>()
      .Name("Questions_#=QuestionGroupTemplateId#")
      .Columns(columns =>
                   {
                       columns.Bound(i => i.QuestionTemplateId).Hidden();
                       columns.Bound(i => i.QuestionGroupTemplateId).Hidden();
                       columns.Bound(i => i.Required);
                       columns.Bound(i => i.QuestionText);
                       columns.Bound(i => i.LifeCycle).ClientTemplate("\\#=LifeCycle.SelectedLifeCycleCsvList\\#");
                   }
      )
      .ToolBar(toolBar => toolBar.Save())
      .Editable(editable => editable.Mode(GridEditMode.InCell))
      .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .Batch(true)
                                    .ServerOperation(false)
                                    .Model(model =>
                                               {
                                                   model.Id(m => m.QuestionTemplateId);
                                                   model.Field(m => m.QuestionTemplateId).Editable(false);
                                                   model.Field(m => m.QuestionGroupTemplateId).Editable(false);
                                                   model.Field(m => m.QuestionText).Editable(false);
                                               })
                                    .Read(read => read.Action("ReadAssignedQuestions", "QuestionManagement", new { p = "#=QuestionGroupTemplateId#"})
                                                      .Type(HttpVerbs.Post)                                                         
                                    )
                                    .Update(update => update.Action("SaveAssignedQuestions", "QuestionManagement"))
      )
      .Events(e => e.Edit("testEvent"))
      .ToClientTemplate()
      )

Here is the Controller:
[HttpPost]
  [HandleJsonException]
  public ActionResult SaveAssignedQuestions([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")] IEnumerable<AssignedQuestionViewModel> models)
  {
      var result = _questionManagementHelper.SaveQuestionAssignmentEdits(models);
      return Json(GetJsonResponse(result, "An error occurred saving assigned question edits."));
  }

Breaking in the controller, copied from the Watch window:

-       LifeCycle   {Esurety.Core.ViewModels.QuestionManagement.QuestionLifeCycleAssignmentViewModel}   Esurety.Core.ViewModels.QuestionManagement.QuestionLifeCycleAssignmentViewModel
-       Items   Count = 6   System.Collections.Generic.List<Esurety.Core.ViewModels.QuestionManagement.QuestionLifeCycleAssignmentItemViewModel>
-       [0] {Esurety.Core.ViewModels.QuestionManagement.QuestionLifeCycleAssignmentItemViewModel}   Esurety.Core.ViewModels.QuestionManagement.QuestionLifeCycleAssignmentItemViewModel
        Assigned    false   bool
        LifeCycleAbbreviation   null    string
        LifeCycleDescription    null    string
        LifeCycleId 0   int
It is kind of hard to read, but you can see that the List of Items has 6 Items, which is a property of LifeCycle, which is a property of the top-level AssignedQuestionViewModel.  Everything is correct (the count of items is correct), except the Items have no values (you can see the nulls and 0 for the ID, and Assigned is always false even when it isn't supposed to be).  When I inspect in fiddler, using the WebForms tab, the data is correct, so it is being submitted, it is the binding that is not working correctly.  Here is from Fiddler WebForms:

group
filter
models[0].QuestionTemplateId 1
models[0].QuestionGroupTemplateId 1
models[0].QuestionText First Name
models[0].Required true
models[0].RequiredCheckedString checked
models[0].LifeCycle.Items[0][LifeCycleDescription] Bond Application
models[0].LifeCycle.Items[0][LifeCycleId] 1
models[0].LifeCycle.Items[0][Assigned] true
models[0].LifeCycle.Items[0][LifeCycleAbbreviation] Nb

And here is the TextView:

sort=&group=&filter=&models%5B0%5D.QuestionTemplateId=1&models%5B0%5D.QuestionGroupTemplateId=1&models%5B0%5D.QuestionText=First+Name&models%5B0%5D.Required=true&models%5B0%5D.RequiredCheckedString=checked&models%5B0%5D.LifeCycle.Items%5B0%5D%5BLifeCycleDescription%5D=Bond+Application&models%5B0%5D.LifeCycle.Items%5B0%5D%5BLifeCycleId%5D=1&models%5B0%5D.LifeCycle.Items%5B0%5D%5BAssigned%5D=true&models%5B0%5D.LifeCycle.Items%5B0%5D%5BLifeCycleAbbreviation%5D=Nb&models%5B0%5D.LifeCycle.Items%5B1%5D%5BLifeCycleDescription%5D=Renewal&models%5B0%5D.LifeCycle.Items%5B1%5D%5BLifeCycleId%5D=2&models%5B0%5D.LifeCycle.Items%5B1%5D%5BAssigned%5D=true&models%5B0%5D.LifeCycle.Items%5B1%5D%5BLifeCycleAbbreviation%5D=Rw&models%5B0%5D.LifeCycle.Items%5B2%5D%5BLifeCycleDescription%5D=Cancellation&models%5B0%5D.LifeCycle.Items%5B2%5D%5BLifeCycleId%5D=4&models%5B0%5D.LifeCycle.Items%5B2%5D%5BAssigned%5D=false&models%5B0%5D.LifeCycle.Items%5B2%5D%5BLifeCycleAbbreviation%5D=Cn&models%5B0%5D.LifeCycle.Items%5B3%5D%5BLifeCycleDescription%5D=Reinstatement&models%5B0%5D.LifeCycle.Items%5B3%5D%5BLifeCycleId%5D=6&models%5B0%5D.LifeCycle.Items%5B3%5D%5BAssigned%5D=false&models%5B0%5D.LifeCycle.Items%5B3%5D%5BLifeCycleAbbreviation%5D=Ri&models%5B0%5D.LifeCycle.Items%5B4%5D%5BLifeCycleDescription%5D=NonPBR&models%5B0%5D.LifeCycle.Items%5B4%5D%5BLifeCycleId%5D=7&models%5B0%5D.LifeCycle.Items%5B4%5D%5BAssigned%5D=false&models%5B0%5D.LifeCycle.Items%5B4%5D%5BLifeCycleAbbreviation%5D=Np&models%5B0%5D.LifeCycle.Items%5B5%5D%5BLifeCycleDescription%5D=PBR&models%5B0%5D.LifeCycle.Items%5B5%5D%5BLifeCycleId%5D=8&models%5B0%5D.LifeCycle.Items%5B5%5D%5BAssigned%5D=false&models%5B0%5D.LifeCycle.Items%5B5%5D%5BLifeCycleAbbreviation%5D=Pb&models%5B0%5D.LifeCycle.SelectedLifeCycleCsvList=Nb%2CRw


Thanks!
Danny
Daniel
Telerik team
 answered on 14 Dec 2012
1 answer
170 views
I have a grid that is populate based on a data source that is changed according to user search criteria. Web page is not refreshed when updating the grid. Here is the problem, Let say that I grouped the grid based on column A after the first search. If I click on the search again with or without changing the search criteria and repopulate the data to the grid, it no longer allow me to group based on any other column except column A ( previous grouping ).

Here is the extract of the code that does the data binding:
 $.ajax({
                    type: "POST",
                    async: true,
                    timeout: 60000,
                    url: serviceMaterialsUrl,
                    data: paramsData,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        $("#grid").val('');
                        $("#grid").html('');
                        $("#grid").kendoGrid({
                            editable: false,
                            dataSource: { 
                                data: data.d,
                                pageSize: 100
                            },
                            sortable: { 
                                mode: "multiple",
                                allowUnsort: true
                            },
                            filterable: true,
                            groupable:true,
                            scrollable:true,
                            resizable: true,
                            columnMenu: true,
                            pageable: {pageSizes: [100, 200, 300]},
                            detailInit: detailInit,
                            columns: [
                                { field: "select", ..." },
                                { field:..... }
                            ]
                        });
                    },
                    error: function (err) {
                        alert('Error');
                    }
                });
Petur Subev
Telerik team
 answered on 14 Dec 2012
3 answers
580 views
Hi All,

How to display "No items to display" in the middle of List view body?
Please do the needful as soon as possible.

Regards,
Partha.
Iliana Dyankova
Telerik team
 answered on 14 Dec 2012
2 answers
114 views
Hello,

can I use FX with Kendo Mobile?

Even declaration fails
    <script src="js/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="js/kendo.all.js" type="text/javascript"></script>
    <link href="css/kendo.common.css" rel="stylesheet" />
    <link href="css/kendo.default.css" rel="stylesheet" />
    <link href="css/kendo.mobile.all.css" rel="stylesheet">
  <div data-role="view" data-layout="layout">
  <div data-role="content">
            <div id="foo">
                I will be animated
            </div>        
        </div>    </div>
var
effectWrapper = kendo.fx($("#foo")); Thanks for help.
axel
Top achievements
Rank 1
 answered on 14 Dec 2012
1 answer
303 views
I have a page with a chart on it that works great on most browsers I've tried.  However, when I run this page on an iPad, then the fetch data fails with an Unauthorized exception.  I've logged on and the authorization cookie should be send to my MVC WebAPI page which is secured to authorized users only.  Is there some way to ensure that the proper cookies are sent with each request?

Thanks!

Lyle

      function createChart() {
        chartDataSource = new kendo.data.DataSource({
          transport: {
            read: {
              url: function () {
                return "/api/TEDMinute/" + CurrentDeviceId + "?QueryType=" + CurrentQueryType + "&EndDate=" + CurrentDate + '&Key2=' + CurrentDeviceId2;
              },
              dataType: "json"
            }
          },
          requestStart: function(e) {
            document.getElementById('errorMsg').innerHTML = '';
          },
          error: function(e) {
            var currentTimeString = GetTimeString();
            document.getElementById('errorMsg').innerHTML = 'Error fetching data at ' + currentTimeString + '! ' + e.status + ': ' + e.errorThrown;
          },
          sort: {
            field: "ReadingDate",
            dir: "asc"
          },
          change: function () {
            $("#chart").data("kendoChart").refresh();
          }
        });
        $("#chart").kendoChart({
          theme: $(document).data("kendoSkin") || "default",
          dataSource: chartDataSource,
          title: { text: "Usage In Days" },
          legend: { position: "top" },
          seriesDefaults: {
            type: "line"
          },
          series:
          [
            { type: "line", field: "kWh",  name: CurrentDeviceName, axis: "WattAxis", color: "#FF9900" },
            { type: "line", field: "kWh2", name: CurrentDeviceName2, axis: "WattAxis", color: "#339900" },
          ],
          categoryAxis: {
            field: "DisplayDate",
            labels: { rotation: -90 }
          },
          valueAxis: [
          {
            name: "WattAxis",
            title: { text: "kWh" },
            min: 0,
            majorUnit: 10,
            color: "#FF9900"
          }],
          tooltip: {
            visible: true,
            format: "{0:N0}"
          },
          legend: {
            position: "bottom"
          }
        });
      }
 $(document).ready(function () {
        setTimeout(function () {
          createChart();
          $("#example").bind("kendo:skinChange", function (e) {
            createChart();
          });
          $("#chart").data("kendoChart").options.title.text = "Energy Usage In Minutes for " + CurrentDeviceName;
        }, 400);
      });
Petur Subev
Telerik team
 answered on 14 Dec 2012
2 answers
226 views
I have a bar chart with an axisLabelClick event defined.  The event fires when the x-axis label is clicked but not when the y-axis is clicked.  This worked in previous versions.  Any help would be appreciated.
Iliana Dyankova
Telerik team
 answered on 14 Dec 2012
1 answer
155 views
Hi, 

Very basic question - Trying to add a simple are chart from example 
http://docs.kendoui.com/howto/add-charts-and-graphs-to-an-application

I am getting the attached error and not able to proceed. I am not sure what all .js files need to be included for the charts. 
Any help is appreciated.

Thanks,
CAS
Hristo Germanov
Telerik team
 answered on 14 Dec 2012
2 answers
430 views
Hi,

I'm using Telerik Extensions for ASP .NET MVC and I want to update to a newer version but only Kendo UI is available. I fine it good and try to migrate my application to Kendo. I've installed the Trial and create a new project with Kendo and it works fine.

So, I go to my old project and create a new view and use the Kendo components, add the reference of kendo, add the scripts and contents, add the links in my sitelayout but it not works with my Telerik Application. I converted my View in a partial View, copy the links and it works fine, but when I use my SiteLayout it doesn't works. I get an error Uncaught TypeError: Object [object Object] has no method 'kendoDatePicker'  if I use a DatePicker and Uncaught TypeError: Object [object Object] has no method 'kendoGrid'  if I use a Grid. So, the problem seems to be in the jquery between Telerik MVC extension and Kendo UI.

Is it possible to use both, telerik mvc extensions and kendo UI or I've to migrate all the application? What can I do to resolve this problem?

This is my Site layout

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/kendo/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2012.2.710/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2012.2.710/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2012.2.710/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/kendo/2012.2.710/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.all.min.js")"></script>

    @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.black.css").Combined(true).Compress(true)))
    @Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.sunset.css"))
    
    @RenderSection("HeadContent", required:false)
    @RenderSection("headerjavascript", required: false)


     @helper selected(string c, string culture)
     {
        if (c == culture)
        {
            @:checked="checked"
        }
     
    }


    @{
        var culture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name.ToLowerInvariant();
    }


    <script type="text/javascript">
        $(function () {
            $("input[type='radio']").click(function () {
                $(this).parents("form").submit(); // apply by posting form
            });


            // highlight selected language
            $("input[type='radio']:checked").next().css("font-weight", "bold");
        });
    </script>


</head>


<body>
    <div class="page">


        <div id="header">
            <div id="title" style="float:left;width:50%;">
                <h1>@BS.Admin.Resources.Menu.TituloAplicacion</h1>
            </div>


            @using (Html.BeginForm("SetCulture", "Home"))
            {
                <fieldset>
                    <legend>Please choose your language</legend>
                    <input name="culture" id="en-us" value="en-us" type="radio" @selected("en-us", culture) /> <label for="en-us">English</label> <br />
                    <input name="culture" id="es-cl" value="es-cl" type="radio" @selected("es-cl", culture) /> <label for="es-cl">Espa�ol</label> <br />
                </fieldset>
            }
             <div id="logon-box" align="right" style="padding:15px;height:60px;">
                @{Html.RenderAction("LogOnBox");}
             </div>
 
               @(Html.Telerik().Menu().HtmlAttributes(new { style = "horizontal-align: left;" })
                    .Name("menu")
                    .Items(menu => {
                        menu.Add().Text(@BS.Admin.Resources.Menu.Home).Action("Index", "Home", new { area = "" });
                        menu.Add().Text(@BS.Admin.Resources.Menu.Consultas).Action("Index", "Home", new { area = "" }).Items(subitem =>
                        {
                            subitem.Add().Text(@BS.Admin.Resources.Menu.EnvioEmails).Action("ConsultasEnvioEmail", "Reportes", new { area = "Jugador" });
                            subitem.Add().Text(@BS.Admin.Resources.Menu.ReenviarActivacionCuenta).Action("ReenvioEmailActivacion", "Messages", new { area = "Jugador" });
                        });
                         
                   }))
           
        </div>


        <div id="main">
            @RenderBody()
            <div id="footer">
            </div>
        </div>
    </div>
@(Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group => group.Combined(true).Compress(true)))</body>
</html>

 this is my viewpage

@using Kendo.Mvc.UI
@model BS.Admin.WebUIMVC.Areas.Financial.Models.ParametrosModel

@{
    ViewBag.Title = "Ver Operaciones";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>VerOperaciones</h2>

@(Html.Kendo().DatePicker().Name("Test"))

and this is the part from where I get the error in Console Developer Tools from Google Chrome

<input class="k-input" id="Test" name="Test" type="date" /><script>
jQuery(function(){jQuery("#Prueba").kendoDatePicker({format:"dd-MM-yyyy",min:new Date(1900,0,1,0,0,0,0),max:new Date(2099,11,31,0,0,0,0)});});
Uncaught TypeError: Object [object Object] has no method 'kendoDatePicker'
</script>
Daniel
Telerik team
 answered on 14 Dec 2012
13 answers
2.6K+ views
Hi There,

I have used a Kendo Grid with its cell editing feature enabled. I am able to successfully bind the grid using the data source & cell edit for non-template columns too works fine.

The attache zip file contains the code for the used .aspx page & also the snapshots of the error I have.

Snapshot 1 shows my Kendo Grid where first 2 columns are Template Columns (Check box & Hyperlink)
Editing on non-template columns is illustrated in Snapshot 2
While editing template columns, on cell click it moves into editable mode, but the text associated to the hyperlink disappears.  Refer Snapshot 3 for details

Could you provide your valuable inputs for?
  • Editing Template Column
  • Adding a Select/Deselect all checkbox on the header row for the template column containing check boxes
Thanks & Regards,
Manoj Kapoor
Marcin Butlak
Top achievements
Rank 2
 answered on 14 Dec 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
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
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?