Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.6K+ views

I realize that these forums are chock full of posts about this, and I have read most of them yet my problem remains.  I'm trying to use the most basic implementation of aggregates, and I keep getting the error 'sum is not defined' or as in my jsFiddle example 'count is not defined'. Could someone please take a look and tell me what I am doing wrong?

var rawData = {
    allData: [
        { employeeId: 1, departmentId: 2 },
        { employeeId: 2, departmentId: 1 },
        { employeeId: 3, departmentId: 3 },
        { employeeId: 4, departmentId: 2 }
    ],
    employees: [
        { value: 1, text: 'John Smith' },
        { value: 2, text: 'Jane Smith' },
        { value: 3, text: 'John Doe' },
        { value: 4, text: 'John White' },
    ],
    departments: [
        { value: 1, text: 'Dept A' },
        { value: 2, text: 'Dept B' },
        { value: 3, text: 'Dept C' },
    ]
};
 
var vm = {
    dsAllData: new kendo.data.DataSource({
        data: rawData.allData
    })
};
 
$(document).ready(function() {
    //kendo.bind($('#ui'), vm);
    $('#myGrid').kendoGrid({
        dataSource: vm.dsAllData,
        groupable: true,
        columns: [
            { field: 'employeeId', title: 'Employee',
             values: rawData.employees, width: 200 },
            { field: 'departmentId', title: 'Department',
             values: rawData.departments, width: 200,
             aggrigate: ['count'], groupFooterTemplate: 'Count: #= count #' }       
        ]
    });
});

Thanks, Jay

Jay
Top achievements
Rank 2
 answered on 23 Oct 2015
1 answer
137 views

Trying to paste in some cells copied from Excel and get "TypeError: this.dialog(...) is undefined" error.

See ERROR HERE below.

 

var SpreadsheetDialog = kendo.spreadsheet.SpreadsheetDialog = kendo.Observable.extend({
        init: function(options) {
            kendo.Observable.fn.init.call(this, options);

            this.options = $.extend(true, {}, this.options, options);
        },
        dialog: function() {
            if (!this._dialog) {
                this._dialog = $("<div class='k-spreadsheet-window k-action-window' />")
                    .addClass(this.options.className || "")
                    .append(this.options.template)
                    .appendTo(document.body)
                    .kendoWindow({
                        scrollable: false,
                        resizable: false,
                        maximizable: false,
                        modal: true,
                        visible: false,
                        width: this.options.width || 320,
                        title: this.options.title,
                        open: function() {
                            this.center();
                        },
                        deactivate: function() {
                            this._dialog.destroy();
                            this._dialog = null;
                        }.bind(this)
                    })
                    .data("kendoWindow");
            }

            return this._dialog;
        },
        destroy: function() {
            if (this._dialog) {
                this._dialog.destroy();
                this._dialog = null;
            }
        },
        open: function() {
            >>>> ERROR HERE >>>> this.dialog().open();
        },
        apply: function() {
            this.close();
        },
        close: function() {
            this.dialog().close();
        }
    });​

Wayne Hiller
Top achievements
Rank 1
Veteran
Iron
 answered on 23 Oct 2015
2 answers
629 views

It seems that the default behavior of the control is to set autocomplete="off" which is fine except Chrome does not like to adhere to this standard.

 Developers should be allowed to override the this default behavior if need be to set the autocomplete type of the textbox, however, setting this via the htmlattributes does not do anything.

 

Example using the MVC Wrappers:

html.Kendo().MaskedTextBoxFor(e).Mask(mask).HtmlAttributes(new { @class = "form-control", autocomplete = "tel-national" })

 

Nick
Top achievements
Rank 1
 answered on 23 Oct 2015
1 answer
197 views

 

I'd like to create a grid that has certain filters already populated. For example:

 

http://codepen.io/vrmerlin/pen/bVadML

 

I would like to have the word "ACTIVE" in the State column's filter value. The user can then edit if desired (or add other filters).  I can't figure out how to do that. any suggestions?

 

Thanks,

John

 

 

Alexander Popov
Telerik team
 answered on 23 Oct 2015
2 answers
236 views

So based on this: http://demos.telerik.com/kendo-ui/upload/angular , I should be able to combine these, but cannot. Am using angular (not v2) and have basically went through this verbatim with no luck. I mean, I drag or select, and it does not show any files. My code in my view is:

 

                    <div class="de

<form>                   
    <div class="demo-section k-content" ng-controller="claimsController">
                        <div>
                            <h4>Upload files</h4>
                            <input name="files"
                                   type="file"
                                   kendo-upload
                                   k-async="{ saveUrl: 'save', removeUrl: 'remove', autoUpload: true }"
                                   k-select="onSelect"
                                   />
                        </div>
                        <div style="padding-top: 1em;">
                            <h4>Console</h4>
                            <div class="console"></div>
                        </div>
                    </div>
</form>

T. Tsonev
Telerik team
 answered on 23 Oct 2015
1 answer
115 views
I want to buy Kendo UI Rich Text Editor control. But i want it in lightweight i.e. the only .CSS and .JS file regarding  control. Is it possible.?
Plamen Lazarov
Telerik team
 answered on 23 Oct 2015
1 answer
1.0K+ views

Hello Everyone,

I am trying to refresh the kendo grid in javascript, when a user click on refresh button. It is working fine in Mozilla browser but in IE11 it is not working properly.

In IE11 refreshing the grid is working one time after that couldn't be able to reload the grid (calling the action method). Please find the following code..

 Controller:

 public ActionResult SelectApprovalFlow([DataSourceRequest]DataSourceRequest request)
        {
            Request objRequest = ((Request)Session["Request"]);

            return Json(GetApproverDetails(objRequest).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }  

Grid:

@(Html.Kendo().Grid<MyProject.Model.GetApprovals>()
        .Name("grdApprovalFlow")
        .Columns(columns =>
        {
            columns.Bound(p => p.ApprovalID).Hidden(true);
           
            columns.Bound(p => p.Approver).Width(120).Title("Approver").HeaderHtmlAttributes(new { style = "text-align:center;font-weight: bold" });
            columns.Bound(p => p.StepDescription).Width(100).Title("Step").HeaderHtmlAttributes(new { style = "text-align:center;font-weight: bold" });                      
        })  
        .AutoBind(false)


        .DataSource(
            dataSource => dataSource
            .Ajax()
                     .Events(events => events.Sync("sync_handler"))
                        .Read(read => read.Action("SelectApprovalFlow", "Approval"))
        )
    )​

 

Button:

<button id="btnApprovalFlow" onclick="return ​btnClick();">            
    My Button
 </button>​

Javascript:

 function ​btnClick() {
        $("#grdApprovalFlow").data('kendoGrid').dataSource.read();
        return false;
    }

 

Thank you so much for your help..

Alexander Popov
Telerik team
 answered on 23 Oct 2015
1 answer
541 views

I use razor Html Helper to create a Kendo UI Grid. The grid is created so the edition of a record is done via a popup window form. Here is the code 

@(Html.Kendo().Grid<MyObject>()
              .Name("grid")
              .Editable(edit => edit
                  .Enabled(true)
                  .Mode(GridEditMode.PopUp)
              )
              .Columns(columns =>
              {
                  // Column declaration
              })
              .ToolBar(toolbar =>
              {
                  toolbar.Create());
              })
              .DataSource(dataSource => dataSource
                  .Ajax()
                  .Model(model => model.Id(m => m.Id))
                  .ServerOperation(false)
                  .Events(e =>
                  {
                      e.Error("error_handler");
                      e.Sync("sync_handler");
                  })
                  .Read("Read", "MyController")
                  .Create(c => c.Action("Create", "MyController"))
                  .Update(u => u.Action("Edit", "MyController"))
              )
        )​

 

I set a handler on both error and sync event of my datasource. The sync handler force a read from the server since some data must be refreshed on create and update operation. The error handler is supposed to prevent the refresh of the grid if an error occur on create or update. Here are both of my handlers

 

function error_handler(e) {
        if (e.errors) {
 
            $('#grid').data("kendoGrid").one("dataBinding", function (ss) {
                ss.preventDefault(); // cancel grid rebind if error occurs
            });   
        }
    }
 
    function sync_handler(e) {
        e.sender.read();
    }
​

My problem is that even if i call ss.preventDefault on the sync action, my sync handler is call anyway and the call to e.sender.read() cause my popup window form to close. If i remove my sync handler, the ss.preventDefault call prevent my popup window form to close correctly, so the problem really is about the sync handler which is always call, even on error. Any idea how I can handle this ?
Kiril Nikolov
Telerik team
 answered on 23 Oct 2015
3 answers
361 views

I'm trying to achieve something that I thought was rather simple...

  1. A kendo Grid bound to a viewModel with a collection of quotes
  2. Each row in the grid must have a list of actions much like Sitefinity's Pages section, i.e. each page has a list of actions
  3. The first action in a row loads the quote in a different SPA view which works because we make use of the Url property of the menuButtons button
  4. The second action is supposed to download a PDF which we're trying to do by binding the click event of the button which is where things go wrong

Note: We could probably achieve this using the router's handler, but I'm hoping to avoid that approach.

If I put a click handler on the menuButton or after the row "type: 'splitButton' it can never find the handler. The same goes for the entire toolbar click handler as can be seen in the examples below.

I also thought of creating a second template that will be called by the first template in which I would create a button and again try binding a click handler.

Problems

When I try to bind directly to any of the click handlers I get a JS handler error coming from Kendo like it can't find the defined handler. "TypeError: handler is not a function - kendo.all.js (line 10790, col 20)"

When I try the templates approach I keep getting a ​Invalid Template exception.

 

<script id="gridRowActionItem" type="text/x-kendo-template">
    <a href="#" data-bind="events: { click: rowItemInToolbarClicked }">Click Me</a>
</script>
 
<script id="gridRowActions" type="text/x-kendo-template">
    <div id="toolbar"
           data-role="toolbar"
           data-items='[
                  {
                type: "splitButton",
                text: "Continue",
                menuButtons: [
                    { text: "Continue Quote", url: "\\#/quote/step1/#:data.quoteId#" },
                    { text: "Download PDF" }
                ]
            },
                {
                     template: kendo.template($("#gridRowActionItem").html())
                }
           ]'
            data-bind="events:{click: OnActionsClick}">
        </div>
</script>       
 
<div id="quotes"
        data-role="grid"
        data-bind="source: quotes"
        data-editable="true"
        data-columns="[
            { 'field': 'description' },
            { 'field': 'status'},
            { 'field': 'broker', 'title': 'Broker},
            { 'field': 'date', 'title': 'Date},
            {
                template: kendo.template($('#gridRowActions').html())
            }]">
</div>

Alexander Valchev
Telerik team
 answered on 23 Oct 2015
1 answer
114 views

I have a named list of periods (name, begin, end) that I would like to display in a gantt like fashion for better overview.

I dont need resources, assignments, tasks etc.

I wonder which widget would be best suited: the gantt, scheduler (timeline) or a scrollable bar chart with a date axis?

Dimitar Terziev
Telerik team
 answered on 23 Oct 2015
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?