Telerik Forums
Kendo UI for jQuery Forum
7 answers
346 views
I have a Kendo grid on a MVC .cshtml view page:   

@model IEnumerable<Models.GetItems>
    <script>
        $(document).ready(function () {
           $("#grid").kendoGrid({
                sortable: true
            });
        });
    </script>    <table class="table" id="grid">
        <thead>
            <tr>
                <th data-field="Quantity">
                    Qty
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.ActionLink(item.Quantity.ToString(), "kendo", "Groups", new { ID = item.ID }, null)
                    </td>
                </tr>
            }
        </tbody>
    </table>

It displays the way I want; as a number with a link to a drill down page, but the sorting doesn't work at all.

How can I tell the grid I want the data type to be a number so it can sort it like a number?

(item.Quantity is Int16 from the model, but had to make it a string for the ActionLink to work)

(I'm open to binding the grid differently if I have to (bind to json output from controller and/or use rowTemplate and/or bind to empty div and define columns in JS possibly with template), but not sure at this point if that will matter, seems like a data type issue regardless of binding method???)

Alexander Popov
Telerik team
 answered on 19 Aug 2014
3 answers
361 views
I'm trying to use a custom transport. Using a grid, the transport methods are getting called. However, when I use DataSource.add(), the transport create method is not getting called. Is this a limitation? JSBin here: http://jsbin.com/xixamugasunu. Thanks.
Jay
Top achievements
Rank 1
 answered on 19 Aug 2014
2 answers
604 views
Hello guys,

I have made only 2 changes to selection.html from listView demos.

1. Changed the theme to kendo.metro.min.css
2. Added background-color property to product class.

Now when I select an item it does not get highlighted. This problem does not occur for default theme. Am i doing  something wrong here or is this a known issue? Either way I'm looking for a solution or workaround. Any help will be really appreciated. 

Thanks in advance.

<!DOCTYPE html>
<html>
<head>
    <title>Selection</title>
 
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.metro.min.css" rel="stylesheet">
    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
     
     
 
    <script>
         
    </script>
</head>
<body>
     
        <a class="offline-button" href="../index.html">Back</a>
     
    <div id="example" class="k-content">
 
    <div class="demo-section">
        <h2>Products</h2>
        <div id="listView"></div>
        <div id="pager" class="k-pager-wrap"> </div>
    </div>
 
    <div class="demo-section">
        <h2>Console Log</h2>
        <div class="console"></div>
    </div>
 
    <script type="text/x-kendo-tmpl" id="template">
        <div class="product">
            <img src="../../content/web/foods/#:ProductID#.jpg" alt="#:ProductName# image" />
            <h3>#:ProductName#</h3>
        </div>
    </script>
 
    <script>
        $(document).ready(function() {
            var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "http://demos.kendoui.com/service/Products",
                            dataType: "jsonp"
                        }
                    },
                    pageSize: 9
                });
 
            $("#pager").kendoPager({
                dataSource: dataSource
            });
 
            $("#listView").kendoListView({
                dataSource: dataSource,
                selectable: "multiple",
                dataBound: onDataBound,
                change: onChange,
                template: kendo.template($("#template").html())
            });
 
            function onDataBound() {
                kendoConsole.log("ListView data bound");
            }
 
            function onChange() {
                var data = dataSource.view(),
                    selected = $.map(this.select(), function(item) {
                        return data[$(item).index()].ProductName;
                    });
 
                kendoConsole.log("Selected: " + selected.length + " item(s), [" + selected.join(", ") + "]");
            }
        });
    </script>
 
    <style>
        .demo-section {
            padding: 15px;
            width: 692px;
        }
        .demo-section h2 {
            font-size: 1.2em;
            margin-bottom: 10px;
            text-transform: uppercase;
        }
        .demo-section .console {
            margin: 0;
        }
        .product
        {
            background-color: #cccccc;
            float: left;
            width: 220px;
            height: 110px;
            margin: 0;
            padding: 5px;
            cursor: pointer;
        }
        .product img
        {
            float: left;
            width: 110px;
            height: 110px;
        }
        .product h3
        {
            margin: 0;
            padding: 10px 0 0 10px;
            font-size: .9em;
            overflow: hidden;
            font-weight: normal;
            float: left;
            max-width: 100px;
            text-transform: uppercase;
        }
 
        .k-listview:after
        {
            content: ".";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }
        .k-listview
        {
            padding: 0;
            min-width: 690px;
            min-height: 360px;
        }
    </style>
</div>
 
</body>
</html>


danparker276
Top achievements
Rank 2
 answered on 18 Aug 2014
1 answer
165 views
I have a menu question:

(1) Can the kendo-menu support the use of a combobox for a menu item? 
(2) If the answer is yes to (1), then I have a question as to how to do it.

I've created a jsfiddle here: http://jsfiddle.net/pjtallman/rg501upb/7/

If I define my kendo menu as follows:

HTML

<ul id="menu"></ul>

JS

$(document).ready(function() {
    var menuItems = [{text: "Apple", url: "http://www.google.com"},
                     {text: "Banana", url: "http:\/www.google.com"},
                     {text: "Orange", url: "http://www.google.com"}];
    
    var menuData = [{text: "Fruits", items: menuItems},
                    {text: "Site", url: "http://www.google.com"},
                    {text: "Location", url: "http://www.google.com"}];
    
    
    var menu = $("#menu").kendoMenu({ dataSource: menuData });
});

This would display a menu such as:

Fruits v | Site | Location

Users would expand the 'Fruits' menu to see a list of sub-menu items (e.g. Apple, Banana, and Orange).

Our requirements are to have the first item, 'Fruits', which will be rendered as a standard menu item drop down in the above code, to be rendered as a combobox (restricted to its list of data items) and to display the text from whatever list item is selected by the user. So, there would be no 'Fruits' text displayed, the menu item would display whatever item's text was selected from the combobox. 

The menu datasource is dynamic so I don't think I can specify this in the html. But I have searched the kendo forums and demos and stackoverflow and can't find any relevant examples. The requirement is for the menu to function as follows. If 'Apple' is selected, the menu would appear as:

Apple v | Site | Location

If the user clicks the dropdown icon and selects 'Banana', the menu would appear as:

Banana v | Items | Inventory  

Thanks,
Chad









Alexander Valchev
Telerik team
 answered on 18 Aug 2014
6 answers
281 views
Is it possible to style the badge?

Looking to make it larger and possibly move it down and in a bit.

thanks for any help.

v.
Iliana Dyankova
Telerik team
 answered on 18 Aug 2014
3 answers
889 views
I'm trying Bootstrap, Jquery Mobile and Kendo UI for choose best framework for develop e-commerce web site. 

Which kendo UI web widget (not mobile widget set) is designed to obtain collapsible left panel like menu of our website (http://www.telerik.com/support). 
Kiril Nikolov
Telerik team
 answered on 18 Aug 2014
2 answers
94 views
Hi,

I want to develop a web based application which runs in a browser of a tablet.
I read about Kendo UI SPA (Single Page Applications) and also kenod.mobile.application.

Which one I should take?
What is the difference between kenod.mobile.application and SPA?

Thanks for any information!

T.
Top achievements
Rank 1
 answered on 18 Aug 2014
2 answers
222 views
Dear all,

I am brand new to Kendo UI SPA anf wanted to create my 1st 'Hello World' application.
To get organized JS files I also wanted to use requireJS, but I could not really get what I want and I need your help (please).

This is my index.html:

<!DOCTYPE html>
<html>
    <head>
        <title>TestApp</title>
    <meta charset="utf-8"/>
    <link href="js/libs/kendo/styles/kendo.common.min.css" rel="stylesheet"/>
    <link href="css/main.css" rel="stylesheet"/>
        <script data-main="js/main" src="js/libs/require.js"></script>
    </head>
    <body>
        <noscript>
            <h3>Javascript muss aktiviert werden!</h3>
            <h3>Javascript must be active!</h3>
        </noscript>
        <h3>TestApp</h3>
        <div id="app"></div>           
    </body>
</html>


This is my main.js:

require.config({
  paths: {
      jquery                                : "libs/kendo/js/jquery.min",
      kendo                                 : "libs/kendo/js/kendo.all.min",
      text                                  : "libs/text",
      indexViewModel                : "models/m_index",
      indexViewTemplate         : "views/v_index.html"
    },
   
    // inform requirejs that kendo ui depends on jquery
  shim: {
      "kendo": {
          deps: ["jquery"]
      }
  }
});
             
require(['jquery', 'kendo', 'myapp'
], function() {
     
    var $ = require('jquery');
    var kendo = require('kendo');
    var myapp = require('myapp');
     
    var App = new myapp();
         
    App.init();
});


This is my myapp.js:

define(function()
{
   
    var myApp = function() {
     
    var constructor,
        app = {},       // public class object of app
 
        constructor = function() {
    console.info('App constructor executed');
         
        return app;
    };
 
    app.init = function() {
        console.info('App started');
 
        // Here I want to enter the code which should create the view and load the template as text
          // The view model should be a requureJS file and the template for the view should be loaded by
          // require text plugin
    };
     
    return constructor.apply(null, arguments);
  };
 
  return myApp;
});


This is what I have so far, and it shows up 'App started' in the browser's console log.
But what I could not get is:

1. Create a view which is a requireJS model
2. This view should load the template from a file using the requireJS text plugin
3. The view should show up inside the DOM's #app DIV.
4. Later on I want to create several views using requreJS module and switch between them

So this is really basic. But I don't know how to combine SPA and requireJS.

I need your help,

Thanks a lot!


T.
Top achievements
Rank 1
 answered on 18 Aug 2014
1 answer
450 views
Hi,

I need to dynamically load the resources of the scheduler object.  Here is an example to explain the issue I am having.

I have a database of over 5,000 people all of whom have events. When the user is looking at a schedule for the month of January I want to load all the events of that month along with all the attendees as resources ( lets say 100 people). I do not want to have to load all 5,000 people as resources as that is going to bog down the network.  When the user then changes the view to February I want to load all the February events and all the February resources. 

The problem I am having is how to dynamically load these people/resources and how to refresh the scheduler once they have loaded.

I don't know if it makes a difference but I am using the scheduler with angular.
Vladimir Iliev
Telerik team
 answered on 18 Aug 2014
1 answer
630 views
I'm attempting to bind a kendo grid to a model in my MVC application
.BindTo((IEnumerable<Jolt.Web.JoltServiceReference.DealDetail>)ViewBag.Detail)
.Editable(editable => editable.Mode(GridEditMode.InLine))

when ever I run my application, I receive:
An exception of type 'System.NotSupportedException' occurred in Kendo.Mvc.dll but was not handled in user codeAdditional information: There is no DataSource Model Id property specified.

Ids this possible? can you point me to anny whitre papers or reference materails?


Daniel
Telerik team
 answered on 18 Aug 2014
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?