Telerik Forums
Kendo UI for jQuery Forum
6 answers
117 views
Hello!
I using Grid on page and want to do some editing of cells.
var grid = $("#daily-tasks-detail-grid").kendoGrid({
    dataSource: {
        transport: {
            read: {
                url: '/json/ords',
                dataType: 'json'
            }
        }
    },
    columns: [
              { title: "Worker"},
              { title: "Description" }
     ],
    rowTemplate: kendo.template($("#rowTemplate").html())
}).data('kendoGrid');
I generate row on this template:
<script id="rowTemplate" type="text/x-kendo-tmpl">
    <tr role="row">
        <td role="gridcell"></td>
        <td role="gridcell"></td>
    </tr>
    <tr role="row">
        <td role="gridcell"></td>
        <td role="gridcell"></td>
    </tr>
</script>
How can I make the data-bind?
For example: <td role="gridcell"><input type="text" data-bind="value: value.name" /></td>
Alexander Valchev
Telerik team
 answered on 13 Aug 2013
6 answers
373 views
my page has three tabs. each time when open one tab, it will download the kendo ui relative js file. i tracked the network request and find out there is an unique id added to the js resource so the browser will not cache the js file properly.
 the url goes like this:
/Scripts/kendo/2013.1.319/kendo.all.min.js?_=1367715372684 

URL Method Result Type Received Taken Initiator Wait‎‎ Start‎‎ Request‎‎ Response‎‎ Cache read‎‎ Gap‎‎
/Scripts/kendo/2013.1.319/kendo.all.min.js?_=1367715372684 GET 200 application/x-javascript 0.66 MB 1.35 s JS Library XMLHttpRequest 1513 0 109 1248 0 1155

Dose anyone konw how to remove the unique id?
Vladimir Iliev
Telerik team
 answered on 13 Aug 2013
1 answer
84 views
Working on a Single App-page designed for tablets/desktops so we want to have a mobile look and feel.
Right now i am looking at 3 kendo.mobile.Application instances.
-one for the main page(2 views: 'main_page' and 'details_page'), also we have 2 way drawer planned for it.
-one app for the right drawer(a filters list(main view) and a new view for each filter 'edit mode')
-one app for the left drawer(a hierarchical list)
Working on this, but i have doubts.
Let me know if this should work(theoretically).

Thanks

Petyo
Telerik team
 answered on 13 Aug 2013
5 answers
115 views
I have a page with 4 splitters. I only want to receive a layoutChange event for a particular splitter. When I resize the window the layoutChange callback is executed 6 times. Within my callback I need to calculate the height of a pane (the height is auto and cannot be pulled from the splitter reference as far as I know). Height calculation is an expensive operation and there is noticeable delay when this happens 6 times in a row. I would prefer to avoid creating a counter and relying on a condition such as if modulus 6 equals 0, calculate height.

I've created the following fiddle to demonstrate my issue: http://jsfiddle.net/kUvLZ/.

  1. Is there a better way to bind my callback that will reduce the number of callback executions?
  2. I don't exactly understand how/why the layoutChange is being triggered like this. Helping me understand it more would probably answer the following related questions
  3. I understand that the child splitter is probably listening to parent splitter resizes. But why 6 times? Why not 3 or 4?
  4. Is there a problem with the splitter control that's causing it to fire this many times? I would expect a parent splitter (.references-wrap in my example) to receive all of the layoutChange events from children. I don't expect a child to have to listen to all of the layoutChanges above it.
  5. Could an alternate bind event be created to make it so that layoutChange listens to all nested calls whereas something like paneLayoutChange would only be triggered once?
Help appreciated.
Ryan
Top achievements
Rank 1
 answered on 13 Aug 2013
1 answer
302 views
I am confused on how to send the save data to an outside controller. Im using kendo for html.   Here is my code for the scheduler. How could I send the data from a save to a controller. 
Thanks

$("#scheduler").kendoScheduler({
                date: new Date("2013/6/13"),
                startTime: new Date("2013/6/13 07:00 AM"),
                height: 600,
                views: [
                "day",
                    { type: "week", selected: true },
                    "month",
                    "agenda"
                ],
                timezone: "Etc/UTC",
                save: scheduler_save,
                remove: scheduler_remove,
                edit: scheduler_edit,
                cancel: scheduler_cancel,
                dataSource: {
                    batch: true,
                    transport: {
                        read: {
                            url: "/Team/Calendar/PopulateCalendar/",
                            dataType: "json",
                            
                        },
                        //update: {
                        //    url: "/Team/Calendar/UpdateAppointment/",
                        //    dataType: "json"
                        //},
                        //create: {
                        //    url: "/Team/Calendar/CreateAppointment/",
                        //    dataType: "json"
                        //},
                        //destroy: {
                        //    url: "http://demos.kendoui.com/service/tasks/destroy",
                        //    dataType: "jsonp"
                        //},
                        parameterMap: function (options, operation) {
                            if (operation !== "read" && options.models) {
                                return { models: kendo.stringify(options.models) };
                            }
                        }
                    },
                    schema: {
                        model: {
 
                            id: "taskId",
                            fields: {
                                taskId: { from: "TaskID", type: "number" },
                                title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                                start: { type: "date", from: "Start" },
                                end: { type: "date", from: "End" },
                                startTimezone: { from: "StartTimezone" },
                                endTimezone: { from: "EndTimezone" },
                                description: { from: "Description" },
                                recurrenceId: { from: "RecurrenceID" },
                                recurrenceRule: { from: "RecurrenceRule" },
                                recurrenceException: { from: "RecurrenceException" },
                                ownerId: { from: "OwnerID", defaultValue: 1 },
                                isAllDay: { type: "boolean", from: "IsAllDay" }
 
                            }
                        }
                         
                    },
                     
                    resources: [
                        {
                            field: "ownerId",
                            title: "Owner",
                            dataSource: [
                                { text: "Alex", value: 1, color: "#f8a398" },
                                { text: "Bob", value: 2, color: "#51a0ed" },
                                { text: "Charlie", value: 3, color: "#56ca85" }
                            ]
                        }
                    ]
                }
            })
        });
Atanas Korchev
Telerik team
 answered on 13 Aug 2013
2 answers
90 views
Hey guys I have some strings in my grid like "Machine2". When I try to sort by Starts with: "Machine2" everything works great. But when I use equals:   "Machine2" I get nothing. Do you know what causes this problem or maybe if I can just leave Starts with sorting ability (which is sufficient).  Also it only occurs when using strings cause when I have int numbers like 100 sorting with equals: "100" works just fine.
Mateusz
Top achievements
Rank 1
 answered on 13 Aug 2013
8 answers
110 views
Are the any plans to add a "Help" action to the window?

This is something we are using with all our application, not just for windows, but for panels too.

See example of what Ext JS has: http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.panel.Tool-cfg-type

regards.
Dimiter Madjarov
Telerik team
 answered on 13 Aug 2013
3 answers
112 views
Hi,

I've just downloaded the new version (2013.2 716) of Kendo UI (also the same problem in 2013.1.514). I created a webservice which returns the desired json for a server groupable grid datasource. The result of the webservice:

{
    "d": {
        "Data": null,
        "Groups": [
            {
                "aggregates": [],
                "field": "Comment",
                "value": "abc",
                "hasSubgroups": false,
                "items": [
                    { "Id": 2, "Comment": "abc" },
                    { "Id": 6, "Comment": "abc" }
                ]
            },
            {
                "aggregates": [],
                "field": "Comment",
                "value": null,
                "hasSubgroups": false,
                "items": [
                    { "Id": 110, "Comment": null }
                ]
            }
        ],
        "Total": 3
    }
}
The setup of the grid and the viewmodel:
<!DOCTYPE html>
<html>
<head>
    <title></title>
 
</head>
<body>
    <script>
        var viewModel = kendo.observable({
            dataSource: new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "MyService.asmx/GetData",
                        dataType: "json",
                        contentType: "application/json; charset=utf-8",
                        type: "POST"
                    },
                    parameterMap: function (data, type)
                    {
                        return kendo.stringify({
                            take: data.take,
                            skip: data.skip,
                            sort: data.sort || [],
                            group: data.group || [],
                            filter: data.filter || null
                        });
                    }
                },
                schema: {
                    data: "d.Data",
                    total: "d.Total",
                    groups: "d.Groups",
                    model: {
                        fields: {
                            Id: { type: 'number' },
                            Comment: { type: 'string' }
                        }
                    }
                },
                pageSize: 100,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true,
                serverGrouping: true
            }),
            onItemSelected: function (e)
            {
                alert('checkbox clicked');
            }
        });
 
        $(document).ready(function ()
        {
            kendo.bind(document.body, viewModel);
        });
    </script>
 
    <div data-bind="source: dataSource" data-role="grid" data-groupable="true" data-pageable="false" data-columns="[{ template: '<input type=\'checkbox\' data-bind=\'events: {click:onItemSelected}\'/>'},{ title:'ID', field: 'Id' },{ title: 'Comment', field: 'Comment' }]">
    </div>
</body>
</html>
When I try to use the grouping feature i got a javascript error:

Uncaught TypeError: Object [object Object] has no method 'get'

I debugged it and I found that the problem is caused by the binding of the checkbox click event (if I remove the checkbox column everything works fine).
There is a function in kendo.binder.js:
01.function flattenGroups(data) {
02.    var idx, length, result = [];
03. 
04.    for (idx = 0, length = data.length; idx < length; idx++) {
05.        if (data[idx].hasSubgroups) {
06.            result = result.concat(flattenGroups(data[idx].items));
07.        } else {
08.            result = result.concat(data[idx].items);
09.        }
10.    }
11.    return result;
12.}
I think the code in line number 8 is not working well, if the data[idx].items is an ObservableArray (the concat adds the observable array as a single element to the result array). I found another implementation of flattenGroups in kendo.data.js:
01.function flattenGroups(data) {
02.    var idx, length, result = [];
03. 
04.    for (idx = 0, length = data.length; idx < length; idx++) {
05.        if (data[idx].hasSubgroups) {
06.            result = result.concat(flattenGroups(data[idx].items));
07.        } else {
08.            result = result.concat(data[idx].items.slice());
09.        }
10.    }
11.    return result;
12.}
By changing the flattenGroups in kendo.binder.js to the version of kendo.data.js, the problem resolved.

Is it a bug (the missing "slice()" from kendo.binder.js flattenGroups function), or am I missing something from my code?
Vladimir Iliev
Telerik team
 answered on 13 Aug 2013
3 answers
293 views
I've got chart that is basically like this: http://jsfiddle.net/huHVd/ (slightly modified from the Kendo examples).

I'm looking for chart legend that would be created only partially so that every legend item would be shown once (not twice as it is in the exmaple chart).

Any comments on that?

Thanks.
Hristo Germanov
Telerik team
 answered on 13 Aug 2013
1 answer
127 views
Hi,

I'm trying to accomplish an TreeView Context menu based on a value in the clicked row.
This is the structure of the treeview:

$("#treeview").kendoTreeView({
dataSource: [{
id: 1, text: "Folder", type: "", items: [
{ id: 2, text: "Document 1", type: true },
{ id: 3, text: "Document 2", type: true }
]
}], 
template: "<div class='#= item.type #' >#= item.text # </div><input type='hidden' class='data-id' value='#= item.id #' /><input type='hidden' class='type-id' value='#= item.type #' />"
});

I'm using the KendoUI.EX extention (https://github.com/insanio/kendoui.ex) for the contextmenu.

var cm = $('#contextMenu').kendoMenuEx({
                        dataSource: [
                            {
                                text: 'ContextMenu',
                                click: function (event) {
                                    alert("Clicked ContextMenu");
                                }
                            }
                        ],
                        anchor: '#TreeView li',
                        delay: 1500
                    });


I need to have something like this:

contextmenu 1 = "Open 1 document", "Show properties"
contextmenu 2 = "Open all documents"

onContextMenuOpen ->
if  type = "document" -> open contextmenu 1
if type = "folder" -> open contextmenu 2

I looked into the events of the treeview and context menu. And there is no event that gets fired between clicking right mouse button and showing the menu.

I hope someone can help me with this, or put me on the right track.
Thanks in advance

Stijn
Alexander Valchev
Telerik team
 answered on 13 Aug 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?