Telerik Forums
Kendo UI for jQuery Forum
1 answer
92 views

I want to populate the current month with dates which are retrieved from a web endpoint, however the value of the dates field is not rendered unless they're set at the time of construction.

How do I make the calendar recognize the change to the dates field?

Kiril Nikolov
Telerik team
 answered on 14 May 2016
1 answer
140 views

http://dojo.telerik.com/@DGOBRIEN/EkIze

 

01.<!DOCTYPE html>
02.<html>
03.<head>
04.    <meta charset="utf-8"/>
05.    <title>Kendo UI Snippet</title>
06. 
08.    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.504/styles/kendo.rtl.min.css"/>
11. 
12.    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
14.</head>
15.<body>
16.   
17.<input id="datepicker">
18.<script>
19.$("#datepicker").kendoDatePicker({
20.    value: new Date(2015,9,3),
21.    disableDates: [new Date(2015,9,12), new Date(2015,9,22), "sa" , "su" ]
22.});
23.</script>
24.</body>
25.</html>

 

How to combine date based and day based disabled dates?

Kiril Nikolov
Telerik team
 answered on 14 May 2016
2 answers
363 views
I'm trying to use the MVC ViewBag to set an items text dynamically.  However I get error messages when I do the following:

items.Add().Text(ViewBag.AppContext.UserDisplayName)

However, if I do something like the below, it works.  So I think it has to do with the ViewBag not being available (timing).

items.Add().Text(User.Identity.Name)

Here's the error when I try and use ViewBag data - CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.

Thoughts?
Jose Molina
Top achievements
Rank 1
 answered on 13 May 2016
2 answers
186 views
Hi,
We studied the stacked bar example published at http://demos.telerik.com/kendo-ui/bar-charts/stacked-bar

We try to implement a similar chart. Our data is based on a dynamic calculation and we currently pack it in the way demonstrated in the example below. We tried various ways to use this data for stacked bars chart and all failed (ended up with an empty output probably because the chart did not know how to "read" our data). Can you please guide us how we can use the following data in order to present a stacked bars chart in which we stack every item. The desired result is a category for each month (for example 7/2015) and for each category we will present a stacked bar consists of the totals of each item bucket for this month:

{
    "items": [
        {
            "itemID": "1827",
            "buckets": [
                {
                    "month": "7/2015",
                    "total": 0,
                },
                {
                    "month": "8/2015",
                    "total": 0,
                },
                {
                    "month": "9/2015",
                    "total": 0,
                },
                {
                    "month": "10/2015",
                    "total": 18.72,
                }
            ]
        },
        {
            "itemID": "1826",
            "buckets": [
                {
                    "month": "7/2015",
                    "total": 10,
                },
                {
                    "month": "8/2015",
                    "total": 5,
                },
                {
                    "month": "9/2015",
                    "total": 0,
                },
                {
                    "month": "10/2015",
                    "total": 0,
                }
            ]
        },
        {
            "itemID": "1957",
            "buckets": [
                {
                    "month": "7/2015",
                    "total": 3.6,
                },
                {
                    "month": "8/2015",
                    "total": 8.2,
                },
                {
                    "month": "9/2015",
                    "total": 0,
                },
                {
                    "month": "10/2015",
                    "total": 0,
                    "counter": 0
                }
            ]
        }
    ]
}
Ron
Top achievements
Rank 1
Veteran
 answered on 13 May 2016
3 answers
968 views

Hi,

I am creating a kendo grid and trying to get paging working. I have updated the dataSource schema so that total is set and I can see from the console.log output that it returns a value but I still get the message "No items to display" and the paging doesnt work. Below is the the kendo grid code and a sample of the json returned. Can anyone see what I am doing wrong?

 

$("#requestBreakdown").kendoGrid({
            dataSource: {
                type: "json",
                transport: {
                    read: "/home/Grid_DataSource?startDate=01/05/2016&endDate=12/05/2016",
                    dataType: "json"
                },
                pageSize: 2,
                serverPaging: false,
                schema: {
                    data: "Data",
                    total: function (data) {
                        console.log(data.Total);
                        return data.Total;
                    },
                }

            },
            groupable: false,
            sortable: true,
            pageable: true,
            columns: [
                { field: "TITLE", title: "Title" },
            ]
        });

 

JSON response

{"Data":[
{"WORKORDERID":1,"TITLE":"First"},
{"WORKORDERID":2,"TITLE":"Second"},
{"WORKORDERID":3,"TITLE":"Third"}
//ADDITIONAL ITEMS REMOVED
],"Total":124}

Chris
Top achievements
Rank 2
 answered on 13 May 2016
7 answers
1.0K+ views
Hello,

I have a treeview in a splitter and on serach i select the node by id and then shouold scroll the treeview so that the selected node is visible. the selection works but treeview will not scroll atall. i have tried Setting focues as well but it will not move at all.

here is the jquery part for selection amnd then scrolling
​ node = treeview.findByUid(ds.get(path[0]).uid);
treeview.select(node);

treeview.trigger("select", { node: node });
node.scrollIntoView(true);
node.Focus();

Thanks

anamika
Alex Gyoshev
Telerik team
 answered on 13 May 2016
2 answers
1.8K+ views

We actually test Kendo UI with angular.

We have an error when we want to update or destroy line in the grid (inline edition mode).

it's certainly an error in the "transport" code block, but i don't find it.

the error is "Cannot read property 'call' of undefined"

the hml part is simplistic :

 

<div kendo-grid k-options="mainGridOptions2" style="height: 600px; width: 900px">

 

this is our Controller code :

 

'use strict';
 
/**
 * @ngdoc function
 * @name kendoTestApp.controller:PersonsPersonslistCtrl
 * @description
 * # PersonsPersonslistCtrl
 * Controller of the kendoTestApp
 */
angular.module('kendoTestApp')
  .controller('PersonsPersonslistCtrl', function ($resource, $scope, $rootScope) {
 
      $scope.mainGridOptions2 = {
          editable:"inline",
          dataSource: {
 
              transport: {
                  read:
                  function(e){
                          
 
                      var testData = [
                          {
                              "FirstName": "Ken",
                              "Id": 1,
                              "LastName": "Ruffort",
                              "ModifiedDateString": "2016-03-15T11:44:33.1370000",
                              "Title": null,
                              "TypeString": "SC"
                          },
                          {
                              "FirstName": "Gigi",
                              "Id": 2,
                              "LastName": "Lopez",
                              "ModifiedDateString": "2002-02-23T00:00:00.0000000",
                              "Title": null,
                              "TypeString": "VC"
                          },
                          {
                              "FirstName": "Robert1",
                              "Id": 3,
                              "LastName": "Tamburello",
                              "ModifiedDateString": "2015-07-18T00:00:00.0000000",
                              "Title": null,
                              "TypeString": "EM"
                          }];
 
                      e.success(testData);
 
 
 
                      },
                  update:
                      function(e){
                          console.log("update");
                      },
                  destroy: function (e) {
                      console.log("destroy");
 
                  },
                  parameterMap: function(options, operation) {
                      if (operation !== "read" && options.models) {
                          console.log("parameterMap");
 
                          return {models: kendo.stringify(options.models)};
 
                      }
                  }
              },
              schema: {
                  model: {
                      fields: {
                          FirstName: {type: "string"},
                          Id: {type: "number"},
                          LastName: {type: "string"},
                          ModifiedDateString: {type: "date"},
                          Title: {type: "string"},
                          TypeString: {type: "string"}
                      }
                  }, parse: function (data) {
                      $.each(data, function (i, val) {
                          val.ModifiedDateString = new Date(val.ModifiedDateString);
                          val.ModifiedDateString.setHours(0, 0, 0, 0);
                         // console.log(val.ModifiedDateString);
 
                      });
                      return data;
                  }
              },
              pageSize: 20,
              batch:false,
              serverPaging: false,
              serverFiltering: false,
              serverSorting: false
          },
          columns: [
              {
                  field:'Id',
                  title: 'Id',
                  width:'70px'
 
              },
              {
                  field:'FirstName',
                  title: 'firstname' ,
                  width:'120px',
                  template:'{{dataItem.Title}} {{dataItem.FirstName}}' ,
                  type:'string',
                  filterable:{
                      cell:{operator:"contains"}
                  }
              },
              {field:'TypeString',title: 'Type' , width:'120px' , type:'string',filterable:{multi:true}},
 
              {field:'LastName',title: 'LastName' , width:'120px' , type:'string'},
              {
                  field:'ModifiedDateString',
                  title: 'ModifiedDateString' ,
                  width:'120px',
                  format: "{0:MMM dd, yyyy}",
                  parseFormats: "{0:MM/dd/yyyy}",
                  headerTemplate: '<label for="check-all"><b>Start Date</b></label>',
                  headerAttributes: { style: "text-align: center;" },
                  attributes: { style: "text-align:center !important;padding-right: 25px;" },
                  filterable: {
                      ui: function (element) {
                          element.kendoDatePicker({
                              format: "MMM dd, yyyy"
                          });
                      }
                  }
              },
              {command:[{name:"edit",text:""},{name:"destroy",text:""}],title:" ", width:"200px"}],
 
          sortable: true,
          pageable:{
 
              pageSizes:[10,20,100,500],
              buttonCount:5
 
 
          },
          scrollable:true,
          toolbar:["create"],
          filterable:true
      };
 
 
 
 
 
 
  });

Alexandre
Top achievements
Rank 1
 answered on 13 May 2016
1 answer
268 views

Is it possible to hide & show child shapes in diagram, upon click event on parent element.

Thanks,

Alen

 

Dimiter Topalov
Telerik team
 answered on 13 May 2016
5 answers
647 views
I have line chart with 2 y axes (valueAxis) representing centimeters and inches. It's important that they align so that the cm value on one is equivalent to the inch value on the other. I have given the cm axis a min of 28 and a max of 55. This means the inch axis would have a min of 11.02 and a max of 21.65. But I want the inch axis to be labeled only on ticks representing whole numbers. Is there a way to do this? I've tried setting the label.skip to 1 and label.majorUnit to .98 so the first label would be at 12. I then created and label.visual function where I modified the label.majorUnit to 1 so the next label would be 13, but this didn't work. It ended up skipping the 13 and labeled the rest with decimals, which was confusing. I've tried a lot of things along these lines. Any suggestions? Thanks.
Iliana Dyankova
Telerik team
 answered on 13 May 2016
1 answer
286 views
I have one datagridview and defined one custom pop up editor.
Please note that i have tried to apply datetime format to DOB (which is datetime field defined in Model) but it does not work. It still return data as 
"Mon Apr 18 2016 10:52:37 GMT+0800 (Malay Peninsula Standard Time)"
I have set the annotation [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy HH:mm}")] in the Model but it only displayed correctly in gridview column, when i double click and bring out the pop up editor, the date time format still show as "Mon Apr 18 2016 10:52:37 GMT+0800 (Malay Peninsula Standard Time)".

The editor content as below:
"
@model Application.Models.CustomerModel

<table class="popup-layout-tbl" style="display: table;">
<tbody>

<tr>
<td>
                <div class="k-edit-label popup-label">
                    @Html.LabelFor(model => model.CustomerID, new { @class = "popup-label-text" } )
                </div>
                <div>
                    @Html.TextBoxFor(model => model.CustomerID, new { @readonly = true, @class = "popup-input" })
                    @Html.ValidationMessageFor(model => model.CustomerID)
                </div>
</td>
</tr>

<tr>
<td>
                <div class="k-edit-label popup-label">
                    @Html.LabelFor(model => model.CustomerName, new { @class = "popup-label-text" } )
                </div>
                <div>
                    @Html.TextBoxFor(model => model.CustomerName, new { @class = "popup-input" })
                    @Html.ValidationMessageFor(model => model.CustomerName)
                </div>
  
</td>
</tr>

<tr>
<td>

                <div class="k-edit-label popup-label">
                    @Html.LabelFor(model => model.DOB, new { @class = "popup-label-text" } )
                </div>
                <div>
                    @Html.TextBoxFor(model => model.DOB, "{0:MM/dd/yyyy}", new { @readonly = true, @class = "popup-input" })
                    @Html.ValidationMessageFor(model => model.DOB)
                </div>
</td>
</tr>

</tbody>
</table>

"
Danail Vasilev
Telerik team
 answered on 13 May 2016
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
Application
Map
Drag and Drop
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?