Telerik Forums
Kendo UI for jQuery Forum
0 answers
153 views
I have an existing datasource as following , 

var data;    
      data = new kendo.data.DataSource(
      {
          type: "odata",
          pageSize: 5,
          endlessScroll: true,
          scrollTreshold: 30,
          transport:{
                       read: {
                           url: "http://odata.netflix.com/Catalog/Titles",
                           dataType: "jsonp",
 
                           data: {
                               Accept: "application/json"
                           }
                       }
                   }
 
               });

I want to create other datasource from this data source. I tried 
var data1 = new kendo.data.DataSource({
                    transport: {
                                   read: data.data()
                                    
                                }
                          });
                 data1.read();

it is throwing exception then I tried 
var data1 = new kendo.data.DataSource({ read: data.data()});
               data1.read();

It is throwing exception in all case.  My req is to create a filtered datasource from existing datasource .

Thanks 
Dhananjay Kumar
Dhananjay
Top achievements
Rank 1
 asked on 21 Jun 2012
0 answers
69 views
We are evaluating the KendoGrid as a candidate solution for a data application currently under design.  The dataset behind this application has a lot of columns.  Therefore, when we initialize the kendogrid, we want to be certain that the columns we ask for in the columns: setup only retrieves those columns from the OData service we have requested.  Typically this is done with a $select=col1,col2 syntax with OData.  For example, the following KendoUI sample feed supports this syntax:

http://demos.kendoui.com/service/Northwind.svc/Orders?$select=EmployeeID

to only return the EmployeeID from the service. 

We set the grid up, and have just a few columns defined.  When we watch the traffic in Fiddler however we can clearly see that the "full dataset" is being returned from the UI. Ideally, whatever we define in the columns: or schema: configuration arguments should filter down what's returned from the OData service. 

Does KendoGrid support this?  What would the configuraiton look like?

Michael
Top achievements
Rank 1
 asked on 21 Jun 2012
5 answers
175 views
Hello support

I would want to apply the same style of kendo controls to vanilla html controls like inputs or textareas.
Is there some predefined way to do it? 

Thanks in advance
Martin
Jeff
Top achievements
Rank 1
 answered on 21 Jun 2012
0 answers
75 views
Hi,

Has anyone come across a Facebook skin that works with KendoUI Mobile?  I did some searching and couldn't come up with anything.

Anyone interested in creating one?  I have small budget.

Thanks,

Sean
Sean
Top achievements
Rank 1
 asked on 21 Jun 2012
16 answers
1.5K+ views
I have been playing around with the WebAPI and have got the paging working. This is a workaround until the day comes when WebAPI and Kendo can work together properly.

The principle is to create a method that has the parameters take, skip, page and pageSize.

Example, in my "Transactions" Controller I have a WebAPI method:
    Public Function GetTransactions(take As Integer, skip As Integer, page As Integer, pageSize As Integer
As
 IQueryable(Of Transaction)        
Return
 repository.GetPaged(take, skip, page, pageSize)     End Function
This will then take the parameters passed by the URL generated from the kendo data source.

Example (from fiddler)
      /[your web api path]/api/Transactions?take=10&skip=0&page=1&pageSize=10

Before this will work, it is important for paging that the kendo data source knows the total number of rows that the query could return if it were not constrained by the take parameter. Not knowing how to add this to the results as a separate field, I added this to each row returned (added a property to the Transaction class). A bit of a waste, but it works.

It required a small function in the schema section of the data source that returns total value from the first row of the data set.

So, to the Kendo code. This uses a shared data source and a grid + chart. Of course, you'll need to change the data/uri to suit your WebAPI data.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--In the header of your page, paste the following for Kendo UI Web styles-->
    <link href="scripts/kendo/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
    <link href="scripts/kendo/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
 
    <!--Then paste the following for Kendo UI Web scripts-->
    <script src="scripts/kendo/js/jquery.min.js"></script>
    <script src="scripts/kendo/js/kendo.all.min.js"></script>
    <title></title>
</head>
<body>
    <div id="example" class="k-content">
            <div id="grid"></div>
            <div id="chart"></div>
 
            <script type="text/javascript">
                var sharedData;
 
                function createChart() {
                    $("#chart").kendoChart({
                        dataSource: sharedData,
                        autoBind: false,
                        legend: {
                            visible: false
                        },
                        series: [{
                            type: "column",
                            field: "Amount"
                        }],
                        axisDefaults: {
                            labels: {
                                font: "11px Tahoma, sans-serif"
                            }
                        },
                        valueAxis: {
                            labels: {
                                format: "{0:N0}"
                            }
                        },
                        categoryAxis: {
                            field: "TransactionCreated"
                        },
                        tooltip: {
                            visible: true,
                            format: "{0:N0}"
                        }
                    });
                }
 
                function createGrid() {
                    $("#grid").kendoGrid({
                        dataSource: sharedData,
                        autoBind: false,
                        height: 250,
                        filterable: true,
                        sortable: true,
                        pageable: true,
                        columns: [{
                            field: "Id",
                            filterable: false
                        },
                        {
                            field: "TransactionCreated",
                            title: "Date Processed",
                            width: 100,
                            format: "{0:MM/dd/yyyy HH:MM}",
                            filterable: false
                        },
                        {
                            field: "TransactionCompleted",
                            title: "Date Complete",
                            width: 100,
                            format: "{0:MM/dd/yyyy HH:MM}",
                            filterable: false
                        },
                        {
                            field: "CardType",
                            title: "Card Type"
                        },
                        {
                            field: "Settled",
                            title: "Settled"
                        },
                        {
                            field: "Amount",
                            title: "Amount",
                            filterable: false
                        },
                        {
                            field: "Currency",
                            title: "Currency"
                        },
                        {
                            field: "OrderReference",
                            title: "Order Reference",
                            filterable: false
                        },
                        {
                            field: "MaskedCardNumber",
                            title: "Card Number",
                            filterable: false
                        },
                        {
                            field: "ReferenceNumber",
                            title: "Reference Number",
                            filterable: false
                        },
                        {
                            field: "ResponseCode",
                            title: "Response Code"
                        }
                    ]
                    });
                }
 
                $(document).ready(function () {
                    sharedData = new kendo.data.DataSource({
                        transport: {
                            read: "http://localhost/WebAPITest/api/Transactions",
                            datatype: "json"
                        },
                        schema: {
                            total: function (result) {
                                var cnt = 0;
                                if (result.length > 0)
                                    cnt = result[0].Count;
                                return cnt;
                            },
                            model: {
                                fields: {
                                    Id: { type: "number" },
                                    TransactionCreated: { type: "date" },
                                    TransactionCompleted: { type: "date" },
                                    CardType: { type: "string" },
                                    Settled: { type: "string" },
                                    Amount: { type: "number" },
                                    Currency: { type: "string" },
                                    OrderReference: { type: "string" },
                                    MaskedCardNumber: { type: "string" },
                                    ReferenceNumber: { type: "number" },
                                    ResponseCode: { type: "string" },
                                    Count: { type: "number" }
                                }
                            }
                        },
                        page: 1,
                        pageSize: 10,
                        serverPaging: true,
                        serverFiltering: true,
                        serverSorting: true
                    });
 
                    createGrid();
                    createChart();
 
                    sharedData.fetch();
 
 
                });
            </script>
    </div>
</body>
</html>

Hope this helps.
Mike
Top achievements
Rank 1
 answered on 20 Jun 2012
3 answers
312 views
Hi. I am new with KendoUI and developing a mobile test app. I connect to a website whene i have a PHP page and gets the categories data from Nothwind database. I got an json as thi s:
{"Result":"OK",
"Rows":[
{"CategoryID":1,"CategoryName":"Beverages","NumProducts":12},
{"CategoryID":2,"CategoryName":"Condiments","NumProducts":12},
....
]
}

And html code is :
        <script type="text/javascript">
        document.addEventListener("deviceready", onDeviceReady, false);


        function onDeviceReady() {
          $.mobile.allowCrossDomainPages = true;
          refreshCategoryList();
       }
       
 // ----------------------------------------------------------
     // Fill Categories List 
     // ----------------------------------------------------------
  function refreshCategoryList() {
var url = 'http://MyServer';
$.getJSON(url, function(res) {
  var result = res.Result;
  if (result == 'OK') {
    var categoryArray = res.Rows;
    $("#categoryList").kendoMobileListView({
    template : '<li><a href="#proPage" oncclik="sessionStorage.cat=${Rows.CategoryID}">${Rows.categoryName}' +
      '<span class="ui-li-count">${Rows..NumProducts}</span></a></li>',
           dataSource: kendo.data.DataSource.create( categoryaArray)
       });     
  }
});
 }
 
        </script> 
        
    </head>
    <body>
    <ul id="categoryList"></ul>
    
<script>
        window.kendoMobileApplication = new kendo.mobile.Application(document.body);
    </script>  

But i got this message in teh web console :

E/Web Console(693): TypeError: Result of expression 'd' [undefined] is not an object. at file:///android_asset/www/js/kendo.mobile.min.js:8

Any hint, please...
Yamil
Top achievements
Rank 1
 answered on 20 Jun 2012
0 answers
180 views
I have a grid that allows a user to display data in both grouped and none grouped format. The datasource (ds) is using json to read the data from the server. The datasource is currently configured to do server side paging and filtering. I would like to also enable this datasource to be able to do server side grouping and Aggregates on the data.

My ds currently defines the schema: { data: "DateList", total: "TotalResults” model: { //fields are declared}}

And my grid currently defines the columns that need to be displayed.

In what format does my code need to returned the grouped data to the ds? And also how do I need to format the Aggregates that are calculated for each grouping?  Keeping in mind that the grid allows for displaying of non grouped and grouped data.  Do I need to change anything with how the ds is defined in regards to the schema? Do I need to change anything with how the grid is defined in regards to the column list?

An example of a grid that allows for grouped and none grouped results and does server side grouping would help.
MK
Top achievements
Rank 1
 asked on 20 Jun 2012
0 answers
124 views
I am trying to get the kendo grid to work for a project I'm working on. It seems as though most of it is working except I can't seem to pass any changing value into the data. I have provided an example jsFiddle: http://jsfiddle.net/9tkg8/2/
I would like the value in the grid to update and reflect the value that is currently stored in the js variable. As you can tell from the example the js variable is being updated(try sorting the columns a couple of times), but the value in the grid isn't. How can I get this to work?
Zack
Top achievements
Rank 1
 asked on 20 Jun 2012
4 answers
415 views
Hello,

Just to be clear on the commercial license agreement, I'm prohibited from changing any part of the source code? Even for internal use where it would not be distributed, it does still violate the agreement? So for example, if I don't like the pager on the Kendo Grid and I want to have a First and Last buttons, my only real option to be in agreement with the license is to contact Telerik, and ask them to support a feature (if they even accept it), and wait for the release?
ryan
Top achievements
Rank 1
 answered on 20 Jun 2012
1 answer
67 views
The documentation for chart configuration is very hard to parse through and find what you are looking for.

http://www.kendoui.com/documentation/dataviz/chart/configuration.aspx

There is no way to go through and find what you are looking for without using CTRL+F in the browser. Can you please consider updating to be more user friendly and allow to find what you are looking for faster?
Brandon
Telerik team
 answered on 20 Jun 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
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?