Telerik Forums
Kendo UI for jQuery Forum
1 answer
118 views
"Select All" checkbox inside the Kendo Grid is not working properly , when the options  “Selectable” and “Scrollable” are enabled .please suggest any solution to this issue
Alexander Valchev
Telerik team
 answered on 17 May 2013
6 answers
197 views
So I've got a model passed in like so:

public class MainViewModel{
    public IList<SubViewModel> SubViewModels;
}
  
public class SubViewModel{
    public Guid Id;
    public string Name;
    public IList<Guid> CategoryIds;
    public IList<CategoryType> CategoryTypes;
}
  
public class CategoryType {
    public Guid Id;
    public string Type;
}
Now in my javascript I take my model and convert:
var initialData = @Html.Raw(JsonConvert.SerializeObject(Model, new JavaScriptDateTimeConverter()));
var mainViewModel = new MainViewModel(initialData);
 
function MainViewModel(data) {
    var mapping = {
        'SubViewModels':
            create: function(options) {
                return new SubViewModel(options.data);
            }
    }
    ko.mapping.fromJS(data, mapping , this);
}
 
function SubViewModel(
     var self = this;

    ko.mapping.fromJS(data, mapping , self);
 
    self.CategoryMultiSelect: function (container, options) {
        $('<input data-bind="value:' + options.field + '"/>')
            .appendTo(container)
            .kendoMultiSelect({
                autoBind: false,
                dataTextField: "Type",
                dataValueField: "Id",
                dataSource: options.model.CategoryTypes
            });
    }
}

ko.applyBindings(mainViewModel, $("#MainViewModel")[0]);

Now when I call the editor function in the grid: 
<div id="subviewModelGrid" data-bind="kendoGrid: {
        data: $data.SubViewModels,
        sortable: true,
        scrollable: false,
           editable: true,
        pageable: { pageSize: 10, input: false },
        columns: [{
            field: 'CategoryIds',
            title: 'Categories',
            width: '300px',
            editor: $data.CategoryMultiSelect
        }]}"/>

After click on the column I get the following error: 

Uncaught TypeError: Object f7ae02dc-c8a7-f112-e043-991018ace7d8 has no method 'get' kendo.web.min.js:12
S.widget.value.m.extend.refresh kendo.web.min.js:12
F.extend.bind kendo.web.min.js:11
v.extend.applyBinding kendo.web.min.js:12
v.extend.bind kendo.web.min.js:12
o kendo.web.min.js:11
o kendo.web.min.js:11
o kendo.web.min.js:11
s kendo.web.min.js:11
d.extend.refresh kendo.web.min.js:22
d.extend.init kendo.web.min.js:22
(anonymous function) kendo.web.min.js:9
p.extend.each jquery-1.8.2.min.js:2
p.fn.p.each jquery-1.8.2.min.js:2
e.fn.(anonymous function) kendo.web.min.js:9
T.extend.editCell kendo.web.min.js:17
r.incell.r.update.n.wrapper.on.on.n.timer kendo.web.min.js:17
p.event.dispatch jquery-1.8.2.min.js:2
g.handle.h

Which is referring to the only id in the array of 'CategoryIds'.  I'm putting this question in Multiselect because I am using editor functions for several other columns and not having this issue. Any thoughts?
Chudi
Top achievements
Rank 1
 answered on 17 May 2013
5 answers
1.5K+ views
I am trying to use the MVC extensions to bind directly to a list of objects.  The data is part of the model that is passed to the view.  I don't want the list view to make an extra call just to get data that is already available.  I am trying to use a combination of BindTo() and ClientTemplateId(), but the resulting list is always empty.
Josh
Top achievements
Rank 1
 answered on 17 May 2013
4 answers
213 views
Hello. I'm Diego. I'm trying to add a chart example into a portlet. But, if i add more than one portlet, i only could see one chart. The other portlets are empty. Y change my jsp page (showing down) to rename the ids of the div chart in each portlet.
Thanks

kendoui.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="namespace"><portlet:namespace/></c:set>

<%
String height = (String)request.getAttribute("height");
String url = (String)request.getAttribute("url");

String divIdStr = "divKendouiPortlet_" + new java.util.Date().getTime();
%>

<html>
<head>
    <title>Basic usage</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" >

    <link href="<%=request.getContextPath()%>/kendoui/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/kendoui/styles/kendo.dataviz.min.css" rel="stylesheet">

    <script src="<%=request.getContextPath()%>/kendoui/js/jquery.min.js"></script>
    <script src="<%=request.getContextPath()%>/kendoui/js/kendo.dataviz.min.js"></script>
    <script src="<%=request.getContextPath()%>/kendoui/shared/js/console.js"></script>
</head>
<body>
         <div id="example<%=divIdStr %>" class="k-content">
            <div class="chart-wrapper">
                <div id="<%=divIdStr %>" style="background: center no-repeat url('<%=request.getContextPath()%>/kendoui/shared/styles/world-map.png');"></div>
            </div>
            <script>
                function createChart() {
                    $("#<%=divIdStr %>").kendoChart({
                        title: {
                            text: "Site Visitors Stats /thousands/ - <%=divIdStr %>"
                        },
                        legend: {
                            visible: false
                        },
                        seriesDefaults: {
                            type: "bar"
                        },
                        series: [{
                            name: "Total Visits",
                            data: [56000, 63000, 74000, 91000, 117000, 138000]
                        }, {
                            name: "Unique visitors",
                            data: [52000, 34000, 23000, 48000, 67000, 83000]
                        }],
                        valueAxis: {
                            max: 140000,
                            line: {
                                visible: false
                            },
                            minorGridLines: {
                                visible: true
                            }
                        },
                        categoryAxis: {
                            categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
                            majorGridLines: {
                                visible: false
                            }
                        },
                        tooltip: {
                            visible: true,
                            template: "#= series.name #: #= value #"
                        }
                    });
                }

                $(document).ready(function() {
                    setTimeout(function() {
                        // Initialize the chart with a delay to make sure
                        // the initial animation is visible

            //alert("READY- <%=divIdStr %>");

                        createChart();

                        $("#example<%=divIdStr %>").bind("kendo:skinChange", function(e) {
                            createChart();
                        });
                    }, 400);
                });
            </script>
            <style scoped>
                .chart-wrapper, .chart-wrapper .k-chart {
                    height: 350px;
                }
            </style>
        </div>

</body>
</html>
Diego
Top achievements
Rank 1
 answered on 17 May 2013
4 answers
128 views
Hello,

We are having some issues with checkbox on IE. (working correctly on Chrome and FF)

When we use IE, it always says that the "checkbox" is mandatory, as soon as we check/uncheck it.

Here is the code :
$("#grid2").kendoGrid({
                         dataSource: {
                            error: errorHandler,
                            transport: {
                           ...
                                parameterMap: function(options, type) {
                                        return JSON.stringify(options);
                                }
                            },
                            schema: {
                                data: "data",
                                total: "total",
                                model: {
                                    id: "id",
                                    fields: {
                                        initials: {     type: "string",
                                                        validation :{
                                                            required: true,
                                                            pattern : "\\w{0,5}",
                                                            "data-pattern-msg": "Maximum 5 chars"
                                                        }
                                                    }, active: {type: "boolean", defaultValue: true},
....
                        columns: [ {
                                field: "initials",
                                title: "${user_list_initials}",
                                width: "10%"
                            },  {
                                field: "active",
                                title: "${user_list_active}",
                                width: "10%",
                                template: "&lt;input type='checkbox'#= active ? 'checked=checked' : '' # disabled='disabled' /&gt; "
                            }, 




This happens with the JSP Wrapper, or when using javascript aswell.

Any hints why it does that ?

The only difference compared to one demo I've seen is that I override the template to display it as a read-only checkbox.

Thank you in advance
Rosen
Telerik team
 answered on 17 May 2013
2 answers
100 views
Hi there,

I'm using he StockChart for displaying a line chart on top of the navigator. It generally works well, but when there are negative values within my Json data, the navigator doesn't mask the unselected data correctly and it overlaps the labels below. What can I do about it? Please see the attached images for an example.

Regards,
Robert
Robert
Top achievements
Rank 1
 answered on 17 May 2013
1 answer
247 views
Hi,

I'm using the Kendo.Mvc.Menu with a site map and security trimming.
My problem is that when all sub items of a menu item are trimmed, the parent item is still being displayed.

I've found an answer to a similar question regarding the Telerik.Menu, on this thread.
However, I could not find the equivalent in the Kendo framework to this line:

<% var navAuthorization = Telerik.Web.Mvc.Infrastructure.ServiceLocator.Current.Resolve<Telerik.Web.Mvc.Infrastructure.INavigationItemAuthorization>(); %>

Best regards,

Assaf
Lauri
Top achievements
Rank 1
 answered on 17 May 2013
2 answers
421 views
Hi - I have a requirement to show our corporate logo from every view, and their preference is to show it in the left-side area of the navbar.  I have it showing up, but it is not vertically centered, and I have tried a number of things. I've tried vertical-align:middle, and margins:auto, but neither have worked so far:

<header data-role="header">
    <div data-role="navbar">
        <img id="corp-logo" src="images/app/corp-logo.png" 
           data-align="left" style="width:120px;height:30px;vertical-align:middle;"/>
        <span data-role="view-title"></span>
    </div>
</header>

and...

<header data-role="header">
    <div data-role="navbar">
        <img id="corp-logo" src="images/app/corp-logo.png"
           data-align="left" style="width:120px;height:30px;margin: auto .3em auto .3em;"/>
        <span data-role="view-title"></span>
    </div>
</header>

What would be preferred approach approach for vertically aligning a logo image within the navbar area?
Thanks, Jim Wangler
Jim
Top achievements
Rank 1
 answered on 16 May 2013
1 answer
54 views
Hi all.  I'm new to the JS/JQuery/AJAX world & new to Kendo controls as well.

Not sure what's going on and would appreciate any help.  My grid displays with an edit and delete button.  Both buttons hit the controller actions as expected and the delete does, in fact delete.  However it, it returns to a blank page instead of a refreshed grid, and my edit button returns raw JSON to an empty view.  I'm guessing I don't have the grid wired correctly so that it know's how to catch the pass.  Here's the code in my partial view.  I commented out some columns that I don't need to see until the edit screen.

Any ideas?  TIA
@{
    Layout = null;
}
@model IEnumerable<Nop.Plugin.Other.Rewards.Models.ReferralProgramModel>
 
@(Html.Kendo().Grid((IEnumerable<Nop.Plugin.Other.Rewards.Models.ReferralProgramModel>)Model)
    .Name("kendoGrid")
    .Columns(columns =>
      {
          //columns.Bound(p => p.Id).Width(0).Hidden();
          columns.Bound(p => p.Name).Width(100).Title("Name");
          //columns.Bound(p => p.ReferralDiscount).Width(20).Title("Friend Discount");
          //columns.Bound(p => p.DiscountEventsPerReferral).Width(100).Title("Discounts per Referral");
          columns.Bound(p => p.PointsAwardPerReferral).Width(100).Title("Points Reward on referral");
          columns.Bound(p => p.MinimumPurchaseForAward).Width(100).Title("Min Purchase Amt");
          //columns.Bound(p => p.RewardEventsPerReferredFriend).Width(100).Title("Discount Events");
          //columns.Bound(p => p.CookieLifespan).Width(100).Title("Cookie Lifespan");
          columns.Bound(p => p.InsertDateUtc).Format("{0:d}").Width(100).Title("Insert Date");
 
          columns.Command(command => command.Edit());
          columns.Command(command => command.Destroy());
      })
     
    .Editable(editable => editable.Mode(GridEditMode.PopUp))    //.TemplateName("ReferralEditForm")
    .Pageable(pager => pager.PageSizes(new[] { 5, 10, 20, 50 }))
    .Sortable()
    .Selectable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => {
            model.Id(p => p.Id);
            model.Field(p=>p.Id).Editable(false);
        })
        .Read(read => read.Action("GetReferralPrograms", "Referrals"))
        .Update(update => update.Action("UpdateRefferalProgram", "Referrals"))
        .Destroy(destroy => destroy.Action("DeleteReferralProgram", "Referrals"))
        .Create(create => create.Action("CreateReferralProgram", "Referrals"))
    )
John
Top achievements
Rank 1
 answered on 16 May 2013
5 answers
602 views
Hi,
 I've been able to create a chart that fits my need except for one requirement which is to show all the series value in a single tooltip (CategoryAxis CrossHairToolTip).

I have 4 series (Weight1, Time1, Weight2, Time2) and 1 category (Period). By default i can easily show the CategoryAxis value in the CategoryAxis CrossHair Tooltip, but what i want to do is show the value of Weight1, Time1, Weight2 and Time2 in that tooltip. 

Here is the code that show the Category value. and in comment what i would like to show instead.

Thanks in advance for your help.

<%: Html.Kendo().Chart<Data.DonneeChart>()
        .Name("chart")
        .Title("Multiple Series Chart")
        .DataSource(dataSource => dataSource
                    .Read(read => read.Action("Charts_Data", "Home")).ServerOperation(false)
        )
        .Series(series => {
            series.Line(model => model.Weight1)
                  .Color("#ff1a1c")
                  .Name("Weight1")
                  .Axis("weight");
            series.Line(model => model.Time1)
                  .Color("#ff0e00")
                  .Name("Time1")
                  .Axis("time");
            series.Line(model => model.Weight2)
                  .Color("#73e100")
                  .Name("Weight2")
                  .Axis("weight");
            series.Bar(model => model.Time2)
                  .Color("#007aff")
                  .Name("Time2")
                  .Axis("time");
        })
        .CategoryAxis(axis => axis
            .Categories(model => model.Period)
            .AxisCrossingValue(0,9999,9999)
            .Justify(true)
            .Crosshair(crosshair => crosshair
                .Visible(true)
                .Tooltip(tooltip => tooltip
                        .Visible(true)
                        .Template("Category : #= value #") // Here i would like to show the value of Weight1,Time1,Weight2,Time2 instead of Period value !!!
                        .Format("{0:n1}")
                        ))
        )
                .ValueAxis(axis => axis
                   .Numeric("weight")
                   .Min(0)
                   .Title("(Kg)")
                   .Max(8000)
               )
               .ValueAxis(axis => axis
                   .Numeric("weight")
                   .Color("#ffae00")
                   .Min(0)
                   .Max(35)
               )
               .ValueAxis(axis => axis
                   .Numeric("weight")
                   .Color("#007eff")
                   .Min(0)
                   .Max(1.1)
               )
               .Tooltip(tooltip => tooltip
                   .Visible(false)
               )
%>

Benoit
Top achievements
Rank 1
 answered on 16 May 2013
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
Iron
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
Iron
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?