Telerik Forums
Kendo UI for jQuery Forum
3 answers
375 views
I have a use case where I need to create multiple separate events when the user clicks 'save' to add a new event in the editor. My server-side is returning an array of events, but the scheduler only adds the first one. Is there a way I can get it to add all of them?

My current work-around is to call dataSource.read() when I detect that multiple events have been returned, but there is a noticeable delay between the first event and the result of dataSource.read() being displayed in the scheduler.

Cheers, Paul.
Vladimir Iliev
Telerik team
 answered on 15 Mar 2016
1 answer
983 views

I have the following grid configuration:

vm.gridData = new kendo.data.DataSource({
    transport: {
        read: function (o) {
            $http.get(constants.getServiceUrl() + 'api/deficiencies')
                .success(function (response) {
                    vm.activeCount = 0;
                    vm.completedCount = 0;
                    for (var i = 0; i < response.length; i++) {
                        response[i].active ? vm.activeCount += 1 : vm.completedCount += 1;
                    }
                    o.success(response);
                })
                .error(function (response) {
                    o.error(response);
                    showToast("Error getting deficiency list.");
                });
        }
    },
    pageSize: 15,
    schema: {
        model: {
            fields: {
                deficiencyNumber: { type: "string" },
                location: { type: "string" },
                deficiencyTypeDescription: { type: "string" },
                description: { type: "string" },
                dateIssued: { type: "date" },
                dateCompleted: { type: "date" },
                statusDescription: { type: "string" },
                notes: { type: "string" },
                municipality: { type: "string" },
                owner: { type: "string" },
                projectNumber: { type: "string" },
                projectName: { type: "string" },
                projectType: { type: "string" },
            }
        }
    },
});
 
vm.gridOptions = {
    columns: [
        { title: "Deficiency #", field: "deficiencyNumber", width: 200, filterable: { cell: { operator: "contains" } } },
        { title: "Location", field: "location", width: 200, filterable: { cell: { operator: "contains" } } },
        { title: "Deficiency Type", field: "deficiencyTypeDescription", width: 200, filterable: { multi: true } },
        { title: "Description", field: "description", width: 200, filterable: { cell: { operator: "contains" } } },
        { title: "Issued", field: "dateIssued", type: "date", format: "{0:dd-MMM-yyyy}" },
        { title: "Completed", field: "dateCompleted", type: "date", width: 200, filterable: { cell: { enabled: true } }, template: "#= (dateCompleted == null) ? ' ' : kendo.toString(dateCompleted, 'dd-MMM-yyyy') #" },
        { title: "Status", field: "statusDescription", width: 200, filterable: { multi: true } },
        { title: "Notes", field: "notes", filterable: { cell: { operator: "contains" } } },
 
        { title: "Municipality", field: "municipality", width: 200, filterable: { cell: { operator: "contains" } }, hidden: true },
        { title: "Owner", field: "owner", filterable: { multi: true }, hidden: true },
        { title: "Project", field: "projectNumber", width: 170, filterable: { cell: { operator: "contains" } }, hidden: true },
        { title: "Project Name", field: "projectName", filterable: { cell: { operator: "contains" } }, hidden: true },
        { title: "Project Type", field: "projectType", filterable: { multi: true }, hidden: true },
    ],
    dataSource: vm.gridData,
    dataBound: function (e) {
        resizeGrid();
        var grid = $("#deficiencyGrid").data("kendoGrid");
        bestFitAllColumns(grid);
    },
    sortable: { mode: "multiple" },
    pageable: {
        pageSizes: [5, 10, 15, 25, 50]
    },
    groupable: true,
    filterable: true,
    columnMenu: true,
    reorderable: true,
    resizable: true,
    navigatable: true,
    selectable: "row",
    height: "98%",
};

I am saving the grids state like so:

var grid = $("#deficiencyGrid").data("kendoGrid");
vm.grid.state = kendo.stringify(grid.getOptions());

This is sent to the api and then the user can click on a menu item to restore the state which runs:

var grid = $("#deficiencyGrid").data("kendoGrid");
grid.setOptions(JSON.parse(vm.gridViews[i].state));

The state string looks like so:

"{"prefix":"","name":"Grid","columns":[{"encoded":true,"title":"Deficiency #","field":"deficiencyNumber","width":122,"filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.deficiencyNumber'>#: data.deficiencyNumber#</span>","headerAttributes":{"id":"6e897ee7-a9ce-4882-b98c-ae84f7c71aaf"}},{"encoded":true,"title":"Location","field":"location","width":293,"filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.location'>#: data.location#</span>","headerAttributes":{"id":"0358a298-c265-4193-bbe0-2dd0fdd7c0e4"}},{"encoded":true,"title":"Deficiency Type","field":"deficiencyTypeDescription","width":148,"filterable":{"multi":true},"template":"<span ng-bind='dataItem.deficiencyTypeDescription'>#: data.deficiencyTypeDescription#</span>","headerAttributes":{"id":"b4ed7b70-03fa-403e-b24f-bdc3477f285e"}},{"encoded":true,"title":"Description","field":"description","width":390,"filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.description'>#: data.description#</span>","headerAttributes":{"id":"92359d3b-0dc8-435d-b010-0909f3e5e91e"}},{"encoded":true,"title":"Issued","field":"dateIssued","type":"date","format":"{0:dd-MMM-yyyy}","headerAttributes":{"id":"3a082046-bf1b-4d0a-b971-b098a9141c84"},"width":101},{"encoded":true,"title":"Completed","field":"dateCompleted","type":"date","width":115,"filterable":{"cell":{"enabled":true}},"template":"#= (dateCompleted == null) ? ' ' : kendo.toString(dateCompleted, 'dd-MMM-yyyy') #","headerAttributes":{"id":"5744d970-93e3-4cd8-b956-61792a1f2a21"}},{"encoded":true,"title":"Status","field":"statusDescription","width":90,"filterable":{"multi":true},"template":"<span ng-bind='dataItem.statusDescription'>#: data.statusDescription#</span>","headerAttributes":{"id":"d52ad07c-4c26-412c-a2bd-561c638aac80"}},{"encoded":true,"title":"Notes","field":"notes","filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.notes'>#: data.notes#</span>","headerAttributes":{"id":"baeb7e50-ccea-456e-a798-3ae89c677d4e"},"width":1550},{"encoded":true,"hidden":true,"title":"Municipality","field":"municipality","width":200,"filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.municipality'>#: data.municipality#</span>","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"deeacd36-e4d4-4ee5-8894-cdefa0fbe9bc","style":"display:none"}},{"encoded":true,"hidden":true,"title":"Owner","field":"owner","filterable":{"multi":true},"template":"<span ng-bind='dataItem.owner'>#: data.owner#</span>","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"15b348a0-797d-481c-bafd-9b885194a0dd","style":"display:none"}},{"encoded":true,"hidden":true,"title":"Project","field":"projectNumber","width":170,"filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.projectNumber'>#: data.projectNumber#</span>","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"c19dd18f-5a50-4b60-b3fb-c1c2cf11dc28","style":"display:none"}},{"encoded":true,"hidden":true,"title":"Project Name","field":"projectName","filterable":{"cell":{"operator":"contains"}},"template":"<span ng-bind='dataItem.projectName'>#: data.projectName#</span>","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"b29717a2-1ea4-4c4f-b553-556791441708","style":"display:none"}},{"encoded":true,"hidden":true,"title":"Project Type","field":"projectType","filterable":{"multi":true},"template":"<span ng-bind='dataItem.projectType'>#: data.projectType#</span>","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"b478a1e6-5b29-4959-b638-6bdc74d5ffdf","style":"display:none"}}],"toolbar":null,"autoBind":true,"filterable":true,"scrollable":true,"sortable":{"mode":"multiple"},"selectable":"row","allowCopy":false,"navigatable":true,"pageable":{"pageSizes":[5,10,15,25,50]},"editable":false,"groupable":true,"rowTemplate":"","altRowTemplate":"","noRecords":false,"dataSource":{"data":null,"schema":{"model":{"fields":{"deficiencyNumber":{"type":"string"},"location":{"type":"string"},"deficiencyTypeDescription":{"type":"string"},"description":{"type":"string"},"dateIssued":{"type":"date"},"dateCompleted":{"type":"date"},"statusDescription":{"type":"string"},"notes":{"type":"string"},"municipality":{"type":"string"},"owner":{"type":"string"},"projectNumber":{"type":"string"},"projectName":{"type":"string"},"projectType":{"type":"string"}}}},"offlineStorage":null,"serverSorting":false,"serverPaging":false,"serverFiltering":false,"serverGrouping":false,"serverAggregates":false,"batch":false,"transport":{"dataSource":null},"select":null,"table":null,"page":1,"filter":{"filters":[{"value":"Out to Field","operator":"eq","field":"statusDescription"}],"logic":"or"},"pageSize":15,"group":[]},"height":"98%","resizable":true,"reorderable":true,"columnMenu":true,"detailTemplate":null,"columnResizeHandleWidth":3,"mobile":"","messages":{"editable":{"cancelDelete":"Cancel","confirmation":"Are you sure you want to delete this record?","confirmDelete":"Delete"},"commands":{"create":"Add new record","cancel":"Cancel changes","save":"Save changes","destroy":"Delete","edit":"Edit","update":"Update","canceledit":"Cancel","excel":"Export to Excel","pdf":"Export to PDF"},"noRecords":"No records available."},"excel":{"proxyURL":"","allPages":true,"filterable":true,"fileName":"Deficiencies.xlsx"},"pdf":{"fileName":"Deficiencies.pdf","proxyURL":"","paperSize":"auto","allPages":true,"landscape":true,"margin":{"left":".5in","right":".5in","top":".5in","bottom":".5in"},"title":null,"author":"PowerVu","subject":null,"keywords":null,"creator":"PowerVu","date":null}}"

In there is a filter.  The grid doesnt change.  I have tried with changing column order, which columns are visible but the grid never changes.

Boyan Dimitrov
Telerik team
 answered on 15 Mar 2016
3 answers
222 views

I still struggle continually with this issue.  If I use a nullable int on my model and use .ForeignKeyFor in my .cshtml, then when I select the first item in the list, it goes blank. I've added .ValuePrimitive(true) to my GridForeignKey.cshtml editor template, but this is still a problem.  Also, I think it's not unreasonable to expect if you add a row to the grid that it would default the value to null and let you select the first item in the list.  I don't think anything I've tried has let me do this.  The best I've been able to do is create an actual item for null with a value of 0 or something and then code it on the server side to treat 0 as null.  I don't feel like this is a great solution.  Anyone had better luck that me?  Telerik do you have a recommendation or an example?

Georgi Krustev
Telerik team
 answered on 15 Mar 2016
1 answer
61 views
One of my kendo grid having a grouping  column. This is affecting my sorting order of records inside the grid. Is there any fix for this issue ?
Konstantin Dikov
Telerik team
 answered on 14 Mar 2016
2 answers
489 views

I have a ComboBox that displays values and text (descriptions) in the drop-down list.  Everything works well, except I need the value to display in the textbox (input) portion of the ComboBox, not the text description.  For example, an entry contains "Jr." as the value and "Junior" as the text description.  When selected, I want the textbox to display "Jr." instead of "Junior".  How can I make this happen?  I'd like to keep the text descriptions in the drop-down if possible.

Thanks.

Joel
Top achievements
Rank 1
Iron
 answered on 14 Mar 2016
6 answers
261 views

Hi there

When binding enabled/disabled or visible/invisible I normally use callback functions to check the current state. Unfortunately the element itself is not given to these callback functions.

In my case, to determine the state of the element, I would need to check if the element, which called the callback function, is part of a disabled tab strip tab. But since there is no element given, I need to search for it in the DOM, which probably is not always reliable and could return multiple elements.

So my Questions:
Why is it, that no params are given to the callback function?
Can I change that?

Regards,
Patric

Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 14 Mar 2016
3 answers
112 views

Hello,

I currently have a grid in my application that has a custom editor template. This template has the default window close, update, and cancel that the editor template provides. I noticed that when I close this editor, my page jumps to the top of the screen. I believe the anchor being set to "#" is the cause. Is this so? Is there a way I can remove this?

Thank you in advance for helping me with this issue.

Alex

Boyan Dimitrov
Telerik team
 answered on 14 Mar 2016
1 answer
616 views

Hi,

How to replace kendo icon (k-plus) with bootstrap icon (glyphicon glyphicon-plus-sign), and kendo icon (k-minus) with bootstrap icon (glyphicon glyphicon-minus-sign) in CSS.

 

Regards,

Rajender Kumar

Helen
Telerik team
 answered on 14 Mar 2016
2 answers
4.4K+ views

I just upgraded to 2016.1.112 and I noticed that the grids now have a grey gradient background color over rows that are hovered over.  The grid did not used to do this in 2015.3.1111.  You can change the target version in the following example to demonstrate:

http://dojo.telerik.com/aDUPi/2

Also, the hover background color of the grid does not follow the hover background color for any other widget and does not seem to be controlled by the same hover background color variable in the styles.  This is evident when you change the "Hover background" color in the theme builder and all widgets have the new hover background color except for the grid:

http://demos.telerik.com/kendo-ui/themebuilder/

How can I either remove the hover background color on grids or change the color to match all other widgets?

 

Thanks,

Michelle

Iliana Dyankova
Telerik team
 answered on 14 Mar 2016
3 answers
1.6K+ views

I'm attempting to use the Grid component's built-in support for exporting to excel, applying custom cell formatting as shown in these Telerik docs:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/excel/cell-format

My question is - how can I identify the actual field / column relating to the cell being formatted from within this handler?  The approach using row / cell indexes comes with the rather obvious issue when exporting a grid with a prior hidden column displayed - best way to reproduce is to refer to this jsfiddle:

https://jsfiddle.net/3anqpnqt/1/

  1. Run fiddle
  2. Click export to excel - observe custom number formatting
  3. Unhide subcategory column (using column menu)
  4. Click export to excel - observe custom number formatting on column 2 which is now 'subcategory'

What I need to be able to do is identify the cell to format as the 'unitPrice' and apply the format, but inspection of the object model within the excelExport handler doesn't give me any way to make this link.  In my real application, I have several custom formats to apply (percentages, n0, n2 etc) so it's not as simple as going $.isNumeric(cell.value) or otherwise.

Am I missing something, or is this simply not possible?

Radoslav
Telerik team
 answered on 14 Mar 2016
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?