Telerik Forums
Kendo UI for jQuery Forum
3 answers
334 views
I have ListView like following:

    <div ng-controller="patientSearchCtrl">
        <div kendo-list-view id="listView" k-data-source="source">
            <div class="product" k-template>
                <h3>{{ dataItem.First_Name }}</h3>
                <p>{{ dataItem.Last_Name }}</p> 
            </div>
        </div>
        <div kendo-pager k-data-source="source"></div>
    </div>


And following AngularJS code:

    angular.module("alertApp", ["kendo.directives"])
            .controller("patientSearchCtrl", function ($scope, $http) {
                var product;
                $http.get('http://localhost:1242/Api/PatientSearch?firstName=Bar&lastName=wells&pageIndex=0&pageSize=10&sortingOrder=FIRST_NAME').
                  success(function (info, status, headers, config) {                     
                      product = info[0]["Table"];
                      console.log(product); 
                  }).
                  error(function (data, status, headers, config) {
                      console.log('Error: ' + data);
                  });
                $scope.source = new kendo.data.DataSource({
                    data: product,
                    pageSize: 1
                });
            });                                                                                                  
   

  console.log(product); is logging data. In Chrome it looks like:
    [Object]
          0: Object
                  DOB: "07-29-1969"
                  First_Name: "Barbara"
                  Last_Name: "Wells"
                  PatientKey: 3
                  RowIndex: 1
                  
I'm using telerik.kendoui.professional.2014.3.1411.trial version.













Petyo
Telerik team
 answered on 19 Mar 2015
3 answers
165 views
At the top of your AngularJS + Kendo introduction documentation (http://docs.telerik.com/kendo-ui/AngularJS/introduction) you specifically mention: "If you are using AngularJS then you probably want to use Angular's own routing mechanism and data binding. Do not mix that with Kendo MVVM."

However, in your Kendo DataSource vs AngularJS Scope documentation (http://docs.telerik.com/kendo-ui/AngularJS/data-source), you specifically mention the problem of using the grid with a standard Javascript object as it will not reflect changes in the grid. You then say that the "fix" to this is to use an ObservableArray as the grid's data source. However, an ObservableArray is part of your MVVM framework.

In light of this, what is Telerik's suggested approach? I tend to agree that AngularJS models and Kendo MVVM should not be mixed. However, then how can the grid work correctly with plain AngularJS Javascript models?

And the reverse is also problematic - if using Kendo MVVM as the View Model, then creating other widgets (eg DateTimePicker, ComboBox, etc) using the Angular-Kendo bindings will fail to appropriately trigger events on the MVVM constructs like ObservableObject, ObservableArray, etc. 

Can you please provide guidance on whether or not Kendo MVVM should be used with Angular-Kendo or not? If yes, please provide examples of how to bind Angular-Kendo widgets to MVVM models complete with event triggering. If no, please provide examples of how to work correctly with the grid when using plain Javascript objects as the DataSource.
Kiril Nikolov
Telerik team
 answered on 19 Mar 2015
6 answers
207 views
hi all
im try use kendoui ,im feel kendoui and other html components(for example text,textarea )different,how to cancel kendui style,To make it look and ordinary?pls help me ,thanks.
Dimo
Telerik team
 answered on 19 Mar 2015
1 answer
517 views
I'm trying to use a "tab" to grab the currently highlighted item in the dropdown and populate it into the the text field. However, I'm having 2 separate problems with this.

The first is that I cannot get the "tab" key's default action to stop from firing. I have tried capturing the keydown even from my MultiSelect box's input field using the following code:

$("#myInput").data().kendoMultiSelect.input.on("keydown",function(event) {
        var code = event.keyCode;
 
        if (code == 9) { //9 is the keyCode for Tab
            event.preventDefault();
        }
}

Using this code, the focus is still moved from the input to the next item on the page and is not giving me the desired functionality of doing nothing when tab is pressed.

My next problem is the fact that I cannot find how kendo determines which item in the list of filtered items is highlighted. I don't see any properties being set when you use the arrow keys to highlight the input you want from that list. I would like to get the displayed text inside that highlighted item and populate it into the text input area when I press tab. Currently I cannot figure out how to figure out how to get the item without selecting it with a click or hitting enter while it is highlighted.

Help with either or both of these would be extremely appreciated.
Georgi Krustev
Telerik team
 answered on 18 Mar 2015
3 answers
448 views
The drop down list is not setting it's value when the value is zero (data-value="0") and I'm not sure why.  The seems to treat the values as numeric instead of a string.  Please see the example:

http://dojo.telerik.com/UroFA

Georgi Krustev
Telerik team
 answered on 18 Mar 2015
3 answers
176 views
Hi,

I'm trying to link a KendoGrid to a WCF service using DataServices & Odata. My requests past JSON but the request formats are ODATA format (i.e. update: myservce.svc/TimeLog(1))

For some reason thought I have been unable to get the KendoGrid to work with the service, I can load data no problem but the Create & Updates don't work, markup below for KendoGrid DataSource:

  $("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: http://localhost/myservice.svc/TimeLog_View,
//type: "GET",
dataType: "json"
},
update: {
                                                       url: function (data) {
return "http://localhost/myservice.svc/TimeLog" + "(" + data.Id + ")";
},
contentType: "application/json; charset=utf-8",
dataType: "json",
//type: "POST"


},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
schema: {
data: function (data) {
return data.value;
},
total: function (data) {
return data['odata.count'];

},
model: {
id: "Id",
fields: {
Id: { type: "number", editable: false, nullable: true },
SOW_Id: { type: "number", editable: false },
Type_Id: { type: "number", defaultValue: 1, validation: { min: 1, required: true } },
//Type_Name: { type: "text", editable: false },
Description: { type: "text" },
EstimatedHours: { type: "number" },
Rate: { type: "number", defaultValue: 225 },
Cost: { type: "number", editable: false },
LoggedHours: { type: "number", editable: false },
AdjustmentHours: { type: "number", editable: false },
CompletedHours: { type: "number", editable: false },
RemainingHours: { type: "number", editable: false },
CreationDate: { type: "date", editable: false },
CreationUser: { type: "text" },
ModifiedDate: { type: "date" },
ModifiedUser: { type: "text" }
}
}
},
//batch: true,
pageSize: 15,
serverPaging: true,
serverFiltering: true,
serverSorting: true


Can anyone point me in the right direction for what I need to do? I have searched the forms and examples but none that I've found solve the problem I'm having

Thanks,
Petur Subev
Telerik team
 answered on 18 Mar 2015
1 answer
152 views
Good afternoon.

How to work with UTC time?

Now I have the following problem from the server response "2014-11-26T18: 52: 48", after the change in the Diagram, is sent to the server in the format "2014-11-26T18: 52: 48Z" and In diagram displays + 2 hours in change the task.

Thank you for your help.
Igor
Top achievements
Rank 1
 answered on 18 Mar 2015
6 answers
144 views
Hello,

We have a big requirement that would basically involve flipping the rows and columns of a grid so the client can view data in a spreadsheet like way.  For example if we have:

Header1 Header 2
Data1       Data2
Data3       Data4

We want:

Header1 Data1 Data3
Header2 Data3 Data4

We have been researching the forums but cant find a standard way to do this.  If this is possible with the kendo grid with custom templates or another control can you please point us in the right direction?

Thanks!
Paul
Top achievements
Rank 1
 answered on 18 Mar 2015
3 answers
65 views
Hi All

I just finished struggling with a resize directive and thought it can be useful to others.

(function () {
    'use strict';
 
    //resize Grid directive
    angular.module('app.core').directive('resize', function ($window) {
        return function (scope, element, attr) {
            var offsetH = attr.resize; //what offset will be removed from the grid height
            var pct = 100; //what % of the page the grid will occupy
 
            if (attr.resizeRatio) { //sets the pct incase it was set in markup
                pct = attr.resizeRatio;
            }
            var w = angular.element($window);
            scope.$watch(function () {
                return {
                    //Used when the window size has changed
                    'height': window.top.innerHeight,
                    'width': window.top.innerWidth,
                    //Used for initialization when the grid has not been rendered and height is 0 triggers the function once the grid is rendered
                    'elementHeight': element.height(),
                    'elementWidth': element.width()
                };
            },
                          function (newValue, oldValue) {
                              for (var i = 0; i < element[0].attributes.length; i++) {
                                  switch (element[0].attributes[i].name) {
                                      case "kendo-grid":
                                      {
                                              //Get Grid data area
                                              var dataArea = element.find(".k-grid-content");
                                              //Calculate the new grid height
                                              var newHeight = (newValue.height * pct / 100) - offsetH;
                                              //Calculate the difrence between the grid to the data area
                                              var diff = element.innerHeight() - dataArea.innerHeight();
                                              //Set new grid height if height is diffrent then the crrent
                                              if (element.height() != newHeight) {
                                                  element.height(newHeight);
                                                  dataArea.height(newHeight - diff);
                                              }
                                              break;
                                          }
                                      case "kendo-splitter":
                                          {
                                              //Calculate the new grid height
                                              var newHeight = (newValue.height * pct / 100) - offsetH;
                                              element.height(newHeight);
                                              break;
                                          }
                                  }
                              }
 
                          },
                          true);
 
            w.bind('resize', function () {
                scope.$apply();
            });
        }
    });
})();

Enjoy 
Kiril Nikolov
Telerik team
 answered on 18 Mar 2015
1 answer
87 views
I am using a kendoGrid with a local data source that is updated when new data is available. This works fine. I recently added row details so I can expand a row and look at the data which also works fine. The issue is that whenever I get an update from the server (that in turn adds records to the DataSource) any row details that are expanded collapse. This is kind of annoying when you are trying to look at the data...

Any idea how to keep the details from collapsing when the DataSource is updated?

Thanks
Dave
Alexander Popov
Telerik team
 answered on 18 Mar 2015
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
Drag and Drop
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?