Telerik Forums
Kendo UI for jQuery Forum
5 answers
174 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
74 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
309 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
178 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
123 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
407 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
63 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
1 answer
138 views
Hi

Are there any plans for a 'Spider Chart', I think that it would be a great addition to your offerings...

Regards

Daryl
Iliana Dyankova
Telerik team
 answered on 20 Jun 2012
0 answers
121 views
Have a look (attached)

So in the example, this is template 1
<script id="campus-template" type="text/x-kendo-template">
    <div class="campus-phase-block" data-bind="attr: {data-campusid: CampusID}">
        <h3 data-bind="text: Campus"></h3>
        <ul data-template="phase-template" data-bind="source: PhaseData" class="phaseBlocks">
             
        </ul>
        <div class="verbs">
            <h3>Available Actions</h3>
            <ul data-template="verb-template" data-bind="source: getVerbs" class="dynamic-list">
 
            </ul>
        </div>
         
    </div>
</script>

..and here's template 2:
<script id="verb-template" type="text/x-kendo-template">
        <li data-bind="click: onRunVerb">
            <span data-bind="text: text"></span>
        </li>
    </script>


So the populating of template 1 works fine, 3 items bound, 3 items displayed.  So template 2 however is supposed to return a list of verbs (getVerbs) based on the current ID of that item.

getVerbs: function (campus) {
//Figure out what phase the campus is in, and apply the right verbs
var dynamicItemVerbs = this.verbs[campus.Phase - 1].verbs
var commonVerbs = this.verbs[7].verbs; //The default items
/*
for (var i = 0; i < itemVerbs.length; i++) {
returnVerbs.push(itemVerbs[i]);
}
*/
var merge = $.merge(commonVerbs, dynamicItemVerbs);
return merge;
},

So debugging, it seems like $merge is appending the dynamic items to commonVerbs.  Does not making a varable off the "this.verbs[7].verbs" make a copy of that array?

What's the preferred way to do this instead?...serialize to JSON and back or something?
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 asked 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
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
ContextMenu
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
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?