Telerik Forums
Kendo UI for jQuery Forum
0 answers
65 views
This is probably simple, but I've not found a solution. I've a ground declared like so:

    <div id="grid" 
         data-role="grid" 
         data-bind="source: tasks" 
         data-columns='[{ "field": "taskId", "width": "150px", "title": "Id" }, ... ]' 
         data-pageable='{ "pageSize": 10 }'
         data-groupable='[{ "field" : "completionStatusDescription", "aggregates": [{"field": "taskId", "aggregate": "count"}] }]'
        >
    </div>

This is bound to a view model and all works fine except for the grouping. Is the above the correct format? I couldn't find explicit docs on this and just guessed, which is probably why it isn't working. The grouping works in the UI, although I can't configure the aggregates.

Is this possible, or have I just got the synax wrong?

Thanks

d
Dave
Top achievements
Rank 1
 asked on 28 Sep 2012
4 answers
807 views
I'm having some issues getting the kendo grid for mvc to work properly (especially the add button in the toolbar). I have a grid with editing in a popup window. For this I'm using a custom template which is in Views/Location/EditorShow.

The edit command is working just fine since this is showing up a popup for the user to edit data in (basically this loads Views/Location/EditorShow like I want it to). The delete command is also working just fine too.

The problem however is the Add command which is situated inside the toolbar. This one does not seem to have a correct url (it's pointing to the root of the website). Also find attached a screenshot showing to source of the add button. If I surf to ?GridLocations-mode=insert manually however a create popup is showing up.

Quite a strange situation, because there seems to be only a problem with the url of the add button in the toolbar.
Any ideas on what may be causing this??

P.S. Below is the code I'm using in my .cshtml file:

@Html.Kendo().Grid(Model).Name("GridLocations").Columns(columns =>
    {
        columns.Bound(l => l.Name).Title("Name");
        columns.Command(command =>
       {      
          command.Edit().Text("Edit");
          command.Destroy().Text("Delete");               
       }).HeaderTemplate("Manage");
         
}).ToolBar(toolbar => toolbar.Create().Text("Create")).DataSource(dataSource => dataSource
        .Server() 
        .Model(model => model.Id(l => l.Id))         
        // Configure CRUD -->       
        .Create(create => create.Action("Create", "Locations"))
            .Read(read => read.Action("Index", "Locations"))
            .Update(update => update.Action("Update", "Locations"))
            .Destroy(destroy => destroy.Action("Delete", "Locations"))       
        // <-- Configure CRUD   
        ).Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("EditLocations"))

I don't think this does contain any strange stuff, since it's mostly the same as the examples on the website.
Any thoughts on why the add button is not working properly like expected?
Willem
Top achievements
Rank 1
 answered on 28 Sep 2012
2 answers
286 views
Hey guys,

I'm using DataSource to drive a sort of "live filtering". After a filter's been applied I reload the data-source with the appropriate get-vars, but I want to add the results-count to this. I'm pretty flexible in how I construct my json (example of current json below), but I'm not sure how I would use kendo to place this somewhere in my html. My json looks like this:

{
 "results": [
{
 "title": "My entry",
 "description: "My description"
},
{
 "title": "Another entry",
 "description: "Another description"
},
]
}

So my questions are:

- Where in my json would I add the result-count?
- How do I make kendo render this to the current document?

Thanks guys!

- Steven
Steven
Top achievements
Rank 1
 answered on 28 Sep 2012
1 answer
185 views
How do you prevent the menu from closing on the mouseout event? I want the menu only close if you click somewhere else outside of the menu.
Kamen Bundev
Telerik team
 answered on 28 Sep 2012
0 answers
42 views
I want to use ' in the text field of the category in this demo: http://demos.kendoui.com/web/grid/foreignkeycolumn.html

But, when I use this character it breaks and will not show any grid at all. Escaping it with \ or using the ascii code did not work at all for me.

Does anyone have some insight on this?

Cheers
Bart
Top achievements
Rank 1
 asked on 28 Sep 2012
1 answer
539 views
Whenever I hit the "create" action on a Kendo Grid, it runs the same server side call for every item in the list that I created.

For example, I have three columns Increment/Range/SetId.

I add one item: 1/1/1
This calls my CreateItem method for the 1/1/1 item.

I add a second item: 2/2/1
This calls my Create Item method for the 1/1/1 item and the 2/2/1 item.

I now have items saved in my database as follows:
1/1/1
1/1/1 (Duplicate)
2/2/1

This pattern continues for as many items as I create. My Kendo code is as follows:

@(Html.Kendo().Grid<Model.IncrementSetItem>()    
            .Name("IncrementSetItemGrid")    
            .Columns(columns => {        
                columns.Bound(p => p.IncrementSetID);
                columns.Bound(p => p.Increment).Width(140);
                columns.Bound(p => p.RangeHigh).Width(140);
                columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
            })
            .ToolBar(toolbar => toolbar.Create())
            .Editable(editable => editable.Mode(GridEditMode.InLine))
            .Pageable()
            .Sortable()
            .Scrollable()
            .DataSource(dataSource => dataSource        
                .Ajax()                 
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(p => p.ID))
                .Create(create => create.Action("CreateItem", "IncrementSet"))
                .Read(read => read.Action("GetIncrementSetItemsList", "IncrementSet"))
                .Update(update => update.Action("UpdateItem", "IncrementSet"))
                .Destroy(destroy => destroy.Action("EditingInline_Destroy", "Grid"))
            )
        )

Please let me know if there is a way to have the "Create" event only act on just the last item that I have created inline.
Alexander Valchev
Telerik team
 answered on 28 Sep 2012
3 answers
501 views
Does anybody know of a way to get the parent node of the node you currently have selected?
Iliana Dyankova
Telerik team
 answered on 28 Sep 2012
1 answer
118 views
I do not know as to copy following code from Kendo UI Fluent to write in JavaScript

Code Kendo UI Fluent

@(Html.Kendo().Chart() .Name("Chart") 
           .DataSource(ds => ds.Read(read => read.Action("ActionName", "ControllerName")
           .Data("filterFunction")))

Code JavaScript
jQuery(document).ready(function($)
{
$("#chart").kendoChart({
   dataSource: {
     transport: {
         read: "ControllerName/ActionName",
      parameterMap: filterFunction
}
},
David
Top achievements
Rank 1
 answered on 28 Sep 2012
1 answer
2.7K+ views
I create my drop down list like so

@(Html.Kendo().DropDownListFor(model => model.Project)
                    .Name("Project")
                                       .DataTextField("ProjectCode")
                                       .DataValueField("ProjectCode")
                                       .DataSource(source =>
                                       {
                                           source.Read(read =>
                                           {
                                               read.Action("GetProjects", "NewTimesheet");
                                           });
                                       })
                                               .Events(e => e.Select("projectChange"))
                                               .SelectedIndex(0)
            )


How do i refresh the data source from the server from a JavaScript event?

Thanks
sarat
Top achievements
Rank 1
 answered on 28 Sep 2012
1 answer
340 views
This code:
var MyModel = kendo.data.Model.extend();
var MyDataSource = kendo.data.DataSource.extend({
    options: {
        transport: {
            create: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            },
            read: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            },
            update: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            },
            destroy: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            }
        },
        schema: {
            model: MyModel,
            data:
'data',
            total:
'total'
        }
    }
});

var myDataSource = new MyDataSource();
var myModel = new MyModel({
    ding: 'dong',
    ping: 'pong'
});

myDataSource.add(myModel);
myDataSource.sync();

Creates this error message:
  1. Uncaught TypeError: Cannot call method 'push' of undefined kendo.web.js:6109
    1. Observable.extend._acceptkendo.web.js:6109
    2. Observable.extend.synckendo.web.js:6067
    3. f.Callbacks.njquery.min.js:2
    4. f.Callbacks.o.fireWithjquery.min.js:2
    5. f.Callbacks.o.firejquery.min.js:2
    6. Observable.extend._promise.$.Deferred.transport.(anonymous function).call.extend.successkendo.web.js:6175
    7. f.Callbacks.njquery.min.js:2
    8. f.Callbacks.o.fireWithjquery.min.js:2
    9. f.support.ajax.f.ajaxTransport.send.djquery.min.js:4

If schema.total is not defined everything works fine.
Unfortunately we need the total because we use a pageable Grid.

Any help or thoughts on that issue?

An example can be found here: http://dl.dropbox.com/u/105042779/kendo/datasource.html (Please look into the source code or console)
Rosen
Telerik team
 answered on 28 Sep 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
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
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?