Telerik Forums
Kendo UI for jQuery Forum
0 answers
842 views
Hi,


I am using the popover with listview and checkbox or radio items. With radio everything works finde, but when I am using checkboxes I get the Error: Uncaught TypeError: Cannot read property 'checked' of undefined
Any idea, what could be wrong? I am creating the Items like this:

$this.children().each(function (i) {
    var $item = $("<li><label>" + $(this).val() + " <input type=\"" + (base.multiple ? "checkbox" : "radio") + "\" " + (this.selected ? "checked=\"checked\"" : "") + " /></label></li>");
    listview.prepend($item);
    var that = this;
    $item.on("click", function () {
        console.log("test");
        that.selected = true;
        $this.ButtonCombobox("setSelection");
    })
});
The error is thrown before output "test" and is thrown by kendo.mobile.min.js.
Kevin
Top achievements
Rank 1
 asked on 09 Nov 2012
0 answers
198 views
Hi, 
The scenario is a div container with data-show="functionW" 
In this function I make a request to the server with some parameters from a previous view and result is shown as a  listview.
$("#listview").kendoMobileListView({
dataSource : dataSource,
click: function(e) {
alert(e.dataItem.foo);
}
});

Fist time everythink works fine, but when the listview is refreshed, the listview show correcty but click function show this error on console: Uncaught TypeError: Cannot read property 'foo' of undefined
The listView changes with some parameters, so I cant use data-init instead of data-show.
I have tried with data-click="functionW" from button of the previous form and same behaviour. 
 Anyone can light me??
Juan Carlos
Top achievements
Rank 1
 asked on 09 Nov 2012
1 answer
111 views
When using the PlotAreaClick event, the e.category value doesn't reflect the point that has been clicked - this seems to be the same in all browsers, and can be replicated on the demo page here - for example, clicking on the right hand side of the plotarea for the 2000 category actually logs a click on the 2001 category.

Is this a known bug and is there a workaround?
Iliana Dyankova
Telerik team
 answered on 09 Nov 2012
1 answer
184 views
I have a kendo treeview and a kendo grid on a page working nicely - when I click on a row in the grid i can drag the row over to the treeview and drop it and this works great.

I want to be able to click on a treeview node and show the products for the selected category within the grid, need some advice.

I have a kendo grid marked as follows:-

viewModel = kendo.observable({ gridSource: productdata });

script>

                var viewModel = null;

                $(document).ready(function() {
                   var treeview;

                    $("#vertical").kendoSplitter({
                        orientation: "vertical",
                        panes: [
                            { collapsible: true, size: "50%" },
                            { collapsible: true, size: "50%" }
                        ]
                    });

                    $("#horizontal").kendoSplitter({
                        panes: [
                            { collapsible: true, size: "35%" },
                            { collapsible: true, size: "65%" }
                        ]
                    });

                    treeview = $("#treeview").kendoTreeView({
                        template: kendo.template($("#treeview-template").html()),
                        dragAndDrop: false,
                        dataSource: [@(Html.Raw(Model.Json))],
                        select: onSelect
                    }).data("kendoTreeView");
                   
                    var productdata = @(Html.Raw(Model.JsonProducts));
                   
                   viewModel = kendo.observable({
                        gridSource: productdata
                   });
                  
                   
                     $("#grid").kendoGrid({
                        dataSource: {
                            data: viewModel.gridSource,
                            pageSize: 10
                        },
                        autoBind:true,
                        selectable: "multiple, row",
                        groupable: false,
                        scrollable: true,
                        sortable: true,
                        pageable: false,
                        drop: droptargetOnDrop,
                        columns: [
                            {
                                field: "id",
                                width: 50,
                                title: "Id"
                            },
                            {
                                field: "categoryid",
                                width: 250,
                                title: "Category Id"
                            }, {
                                field: "productname",
                                width: 250,
                                title: "Product Name"
                            }
                        ]
                    });

                    $("#grid").kendoDraggable({
                        filter: "tr",
                        hint: function() {
                            var g = $("#grid").data("kendoGrid");
                            return g.select().clone();
                        }
                    });

                    $("#treeview").kendoDropTarget({
                        dragAndDrop: true,
                        drop: droptargetOnDrop
                    });
                });

                    function onSelect(e) {
                        var url = "/home/UpdateListingByCategory";
                        var selectedCatId = $(e.node.children[0]).find("input").val();

                        $.ajax({
                            type: "POST",
                            url: url,
                            data: { categoryId: selectedCatId },
                            success: function(data) {
                                viewModel.gridSource = JSON.parse(data);
                                alert(viewModel.gridSource);
                            },
                            error: function() {
                                alert("error");
                            }
                        });
                    }
                   
                    function droptargetOnDrop(e) {
                    var ss = e.srcElement.parentElement.children[1];
                    var url = "/home/update";

                    var list = new Array();

                    for (var i=0; i < e.draggable.hint.length; i++) {
                        var id = e.draggable.hint[i].firstChild.innerHTML;
                        list.push(id);  
                    }

                    $.ajax({
                        type: "POST",
                        url: url,
                        data: { categoryId: $(ss).val(), productIds: list.join() },
                        success: function(data) {
                            viewModel.gridSource = JSON.parse(data);
                        },
                        error: function() {
                            alert("error");
                        }
                    });
                       
                    kendo.bind($("#grid"), viewModel);
                }
            </script>


 

 

 

 

Danny
Top achievements
Rank 1
 answered on 09 Nov 2012
1 answer
209 views

Requirements

Kendo UI for ASP.NET MVC Q2 2012 SP1


jQuery v1.7.1


IE8, FF18


Components/Widgets Grid



PROJECT DESCRIPTION 
I'm trying add a grid column with a Razor ActionLink to pass two parameters to a controller action and display the record details in a new view.  The Grid loads the data, but my "view" link does not show up in the Grid.

This works with the MVC3 Razor WebGrid, but I cannot get it to work with the Kendo Grid. 

Here is my Grid layout:
@(Html.Kendo().Grid(Model)            //The grid will be bound to the Model which is the Products table
          .Name("ApplicationPersonal") //The name of the grid is mandatory. It specifies the "id" attribute of the widget.
      .Columns(columns =>
      {
          columns.Bound(p => p.Id);   //Create a column bound to the "ProductID" property
          columns.Bound(p => p.LastName).Title("Last");   //Create a column bound to the "ProductID" property
          columns.Bound(p => p.FirstName).Title("First"); //Create a column bound to the "ProductName" property
          columns.Bound(p => p.appid).Title("APP ID");   //Create a column bound to the "UnitPrice" property
          columns.Bound(p => p.Email).Title("Email");//Create a column bound to the "UnitsInStock" property
          columns.Bound(p => p.HomePhone).Title("Phone");//Create a column bound to the "UnitsInStock" property     
          columns.Bound(p => p.DOB).Title("DOB");//Create a column bound to the "UnitsInStock" property   
          columns.Template(p =>
       {
        
           @Html.ActionLink("view", "ViewApplicant", "Admin", null, null, null, null, new { appid = p.appid, uid = p.Id });
           
       });
              
      })
                     
)

Thanks.
Hassan
Top achievements
Rank 1
 answered on 09 Nov 2012
1 answer
128 views

So, on the KendoEditor there is a Tooltip field. as the title states, this field only populates the Alt attribute. This only works as a tooltip in IE <= 7. It should be populating the Title attribute (or, perhaps both for compatibility) or be renamed to match what it actually does.

Alexander Valchev
Telerik team
 answered on 09 Nov 2012
4 answers
212 views
The issue is simple.  Without uncommenting the code that you will notice in the fiddle, binding to a viewmodel (kendo.observable) that contains a kendo.data.DataSource simply fails.  

http://jsfiddle.net/dotBomb/PMXWU/

Why?

Form binding clearly doesn't work the same way as kendoGrid binding, which I have working using a kendo.data.DataSource.  Seriously frustrating.  Not to mention when I wire this up to a transport with URLs, trying to sync the datasource via the sync() method, after editing data, fails miserably.  

Note: the collective opinion on the kendo web ui forums is that anything other than the simplest of scenarios usually fails.  I share this opinion.  

Dan


Daniel
Top achievements
Rank 1
 answered on 09 Nov 2012
1 answer
128 views
Is there a way to zoom the bubbles on mouse over and shrink back to original size when the mouse goes away. 
Thanks.
scorp
Top achievements
Rank 1
 answered on 09 Nov 2012
1 answer
201 views
I want the calendar to be "view only" (bound with MVVM)

Is there a way to perhaps disable it?  disabled="disabled" doesnt do anything
Guillermo
Top achievements
Rank 1
 answered on 09 Nov 2012
2 answers
274 views
I'd like to have a datetimepicker that displays the date and time by default but only displays the date if the time is midnight. It should update the format when the value is changed. I can format the value when the datetimepicker is created to one or the other format, but if the time changes, I can't seem to update the picker's format. Any ideas on how to do this?

http://jsbin.com/ekilok/1/

$(document).ready(function () {
  var dateFormat = "{0:M/d/yy}";
  var datetimeFormat = "{0:M/d/yy h:mm tt}";
  var d = new Date(2012, 11, 8, 11, 20);
  var d2 = new Date(2012, 11, 8);
    
  $('#StartWithDate').kendoDateTimePicker({
      value: d,
      format: (d.getHours() === 0) ? dateFormat : datetimeFormat,
    change: function(e) { /* what goes here */ }
  });   
  $('#StartWithDateTime').kendoDateTimePicker({
      value: d2,
      format: (d2.getHours() === 0) ? dateFormat : datetimeFormat,
      change: function(e) { /* what goes here */ }
  });   
});
Sypher
Top achievements
Rank 1
 answered on 09 Nov 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
Drag and Drop
Application
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
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?