Telerik Forums
Kendo UI for jQuery Forum
4 answers
281 views

I need to make a diagram in which some connections are a different color, according to connection data.  For example, I may have this as connections datasource: 

 

[
  {from: 1, to: 2, type: 1},
  {from: 1, to: 3, type: 2},
  {from: 2, to: 4, type: 1}
]

The resulting diagram should have connections with one stroke color (black) for the connections from 1 to 2 and 2 to 4, and a different stroke color (red) for the connections from 1 to 3 (as it is a different type). 

 

I tried looking for something similar to `shapeDefaults.visual`, but it appears `connectionDefaults` only has this option for the content (text of the connection?), and not the stroke. 

 

Is there a way to customize the stroke color (and preferably also dash) according to the connection data?

 

Thanks. 

Vessy
Telerik team
 answered on 31 Mar 2016
1 answer
1.4K+ views
In my grid i have enabled virtual scrolling and server side paging. but as i was scrolling i noticed sometimes when i scroll its not sending a new request to grab new data even if its reached page size. I think its because of catching of data. I tried to set catch property to false in my ajax call but it didnt fix my issue. I was wondering how this can be done. does Kendo can provide us with a functionality?
var dataSource = {
    transport: {
        read: function (options) {
            var success = function (response) {
                options.success(response);
            };
 
            var error = function (xhr, status, error) {
                Ember.Logger.error('Fail response: ' + xhr.responseText + ' (status=' + xhr.status + ' ' + error + ')');
            };
            _this.get('PopulateGridData')(gridUrl, success, error, options.data, 'POST', true, true);
        },
    },
    pageSize: gridPageSize,
    schema: gridSchema,
    serverPaging: true,
    serverSorting: true,
    serverGrouping: true,
    serverFiltering: true,
};
 
var gridOptions = {
    dataSource: dataSource,
    columns: gridColumns,
    editable: gridEditable,
    pageable: {
        refresh: true,
        numeric: false,
        previousNext: false,
    },
    height: gridHeight,
    scrollable: {
        virtual: true,
    },
    groupable: true,
    filterable: true,            
};
 
var grid = Ember.$("#kendo-grid").kendoGrid(gridOptions).data('kendoGrid');
 
_this.set('kendoGrid', grid);
Dimiter Topalov
Telerik team
 answered on 31 Mar 2016
1 answer
211 views

Hi,

 

I'm filtering my grid by using passing in a function to the operator like this:

 

dataSource.filter({
    operator: setFilter
    }
})

var setFilter = function(item) {

// iterate each item and return true or false if item matches value

}

 

this works perfectly and returns the correct view.  However, I need access to the filters applied.  Calling dataSource.filter().filters is returning empty object {}.  Can you help please?

Boyan Dimitrov
Telerik team
 answered on 31 Mar 2016
1 answer
1.1K+ views

When I call grid.setOptions I get the error message "Custom commands should have name specified".

This is the saved options (localStorage) I try to set:

{"prefix":"","name":"Grid","columns":[{"encoded":true,"hidden":true,"field":"id","title":"Id","width":90,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"3c3652ad-0b29-4fa3-babb-b34fd703b64d","style":"display:none"}},{"encoded":true,"field":"task","title":"Task","headerAttributes":{"id":"9f9c5a17-e285-4781-9bd6-8a7c2dfd93af"}},{"encoded":true,"hidden":true,"field":"description","title":"Description","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"7e36d3a8-ec2c-4617-b409-5066a88273c7","style":"display:none"}},{"encoded":true,"hidden":true,"field":"files","title":"Files","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"b10e9159-5a0d-4550-93fd-19c1a8099465","style":"display:none"}},{"encoded":true,"title":"Period (Deadline)","minScreenWidth":768,"headerAttributes":{"id":"ee717db3-5d7a-489a-b0b0-e4db29586ccb"}},{"encoded":true,"hidden":true,"field":"begin","title":"Start","format":"{0:dd-MMM-yyyy}","width":100,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"e2e6910e-41e3-4a0e-b836-2fd0c7bc075e","style":"display:none"}},{"encoded":true,"hidden":true,"field":"end","title":"End","format":"{0:dd-MMM-yyyy}","width":100,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"b1ba8653-8c31-4509-b971-41d12cc4781f","style":"display:none"}},{"encoded":true,"hidden":true,"field":"deadline","title":"Deadline","format":"{0:dd-MMM-yyyy}","width":100,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"6c6fd996-856a-4cd5-873e-854b77c70f06","style":"display:none"}},{"encoded":true,"hidden":true,"field":"category","title":"Category","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"ebfa68db-a58d-4374-8142-b7f00deac354","style":"display:none"}},{"encoded":true,"hidden":true,"field":"storeLocation","title":"Store location","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"cabd1bfd-f059-4746-b2e2-8e1f13b15d20","style":"display:none"}},{"encoded":true,"hidden":true,"field":"checklist","title":"Checklist","filterable":{"multi":true},"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"618147df-a971-4771-bfe6-c3ca64b4cc8b","style":"display:none"}},{"encoded":true,"hidden":true,"field":"manager","title":"Manager","filterable":{"multi":true},"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"43337326-6f60-4669-9068-30116a33de62","style":"display:none"}},{"encoded":true,"hidden":true,"field":"respType","title":"Responsibility","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"3e76bba2-a39a-482f-bc67-89646c93fc31","style":"display:none"}},{"encoded":true,"hidden":true,"field":"purpose","title":"Purpose","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"0554ea78-d6ff-44a7-996c-d8849a81a7e7","style":"display:none"}},{"encoded":true,"hidden":true,"field":"active","title":"Active","width":90,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"a0947002-b6a6-4501-9bf7-a226ecffcead","style":"display:none"}},{"encoded":true,"hidden":true,"field":"storeCount","title":"Stores","width":90,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"95955092-27eb-4ba0-8a80-63366e49711a","style":"display:none"}}],"toolbar":[{}],"autoBind":true,"filterable":true,"scrollable":true,"sortable":true,"selectable":false,"allowCopy":false,"navigatable":false,"pageable":{"refresh":true,"buttonCount":3,"pageSizes":[10,25,50,100],"messages":{"empty":"","display":"{0}-{1} / {2}","itemsPerPage":""}},"editable":false,"groupable":false,"rowTemplate":"","altRowTemplate":"","noRecords":{"template":"<span class='ise-grid-empty'>No data</span>"},"dataSource":{"data":null,"schema":{"model":{"fields":{"id":{"type":"number"},"task":{"type":"string"},"begin":{"type":"date"},"end":{"type":"date"},"deadline":{"type":"date"},"category":{"type":"string"},"storeLocation":{"type":"string"},"checklistId":{"type":"number"},"checklist":{"type":"string"},"completedCount":{"type":"number"},"storeCount":{"type":"number"},"active":{"type":"boolean"},"managerId":{"type":"number"},"manager":{"type":"string"},"respTypeId":{"type":"number"},"respType":{"type":"string"},"respShort":{"type":"string"},"description":{"type":"string"},"purposeId":{"type":"number"},"purpose":{"type":"string"},"isPast":{"type":"boolean"},"isCurrent":{"type":"boolean"},"isFuture":{"type":"boolean"}}}},"offlineStorage":null,"serverSorting":false,"serverPaging":false,"serverFiltering":false,"serverGrouping":false,"serverAggregates":false,"batch":false,"transport":{"read":{"type":"POST","url":"/System/GetTasks","dataType":"json","contentType":"application/json; charset=utf-8"},"dataSource":null},"sort":[{"field":"begin","dir":"asc"}],"pageSize":10,"page":1,"group":[]},"height":null,"resizable":true,"reorderable":false,"columnMenu":{"sortable":false},"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":false,"filterable":false,"fileName":"Export.xlsx"},"pdf":{"fileName":"Export.pdf","proxyURL":"","paperSize":"auto","allPages":false,"landscape":false,"margin":null,"title":null,"author":null,"subject":null,"keywords":null,"creator":"Kendo UI PDF Generator v.2016.1.322","date":null}}

 

 

 

Rosen
Telerik team
 answered on 31 Mar 2016
1 answer
351 views

Hi All,

I'm currently trialing KendoUI  Professional for a project. Particularly I'm interested in the Diagram component however there are two critical elements I would like to customize.

I would like to make the connectors custom shapes. For example I would like certain shapes that can be connected to each other (based on business rules) to have unique connector shapes to make it clear to the user which shapes can be connected. At the moment there seems to be no way to do this out of the box (I acknowledge I can do colors though).

I would also like to make connections, curved/splines as per this feature request: 
http://kendoui-feedback.telerik.com/forums/127393-telerik-kendo-ui-feedback/suggestions/6589127-diagram-connection-line-styling

I am pretty confident in my ability to add these modifications once I purchase a license and gain access to the Diagram source code however I'm wondering if anyone has has any experience trying to modify Diagram and whether these two customizations are realistic possibilities. Otherwise I may have to make something from scratch with SnapSVG or similar.

Just a tad worried about purchasing a license and then realizing that I can't get the desired result anyway.

Cheers

Chris 

 

 

Daniel
Telerik team
 answered on 31 Mar 2016
2 answers
680 views

Hi. I'm trying to use the ng-if or ng-show tags within a custom column template. Unfortunately there seems to be no effect when I change the underlying variable.

gridColumns.push({
    field: currentField.FieldName.replace(/ /g, "_"),
    title: currentField.FieldName,
    template: function (dataItem) {
        return $scope.sampleNameTemplate(dataItem);
    }
                         
    //,locked: true
    , width: 250
    , editor: $scope.textBoxCmtEditor
});

 

$scope.showQaQcSamplesEnabled = function () {
    return $scope.showQaQcSamples;
};

In my grid there is no change regardless of what the $scope.showQaQcSamples variable is set to.

 

Any idea how I can get ng-if or ng-show to work correctly within a custom column template?

 

Thanks,

Ian

Radoslav
Telerik team
 answered on 31 Mar 2016
1 answer
331 views

I'm trying to get a grid with a date field that must have a value. I have set the schema field validation to "required: true", but the grid still happily saved with nothing in the date field. 

How to I get the grid to disallow saving if there is no value in the date field? (I don't need to set a range for the date, just make sure it is there). 

 

Here is my attempt: http://dojo.telerik.com/aWAxO/2

Boyan Dimitrov
Telerik team
 answered on 31 Mar 2016
1 answer
78 views

HI, I'm beginner for Telerik Platform with hybrid app. Sorry for this dummy question. I'm trying to load a scheduler with a web service which returns the following:

 

{"JSONDataResult":[{"Description":"Full Name","End":"\/Date(1458450000000-0500)\/","EndTimezone":null,"IsAllDay":true,"OwnerID":"1","RecurrenceException":null,"RecurrenceID":null,"RecurrenceRule":null,"Start":"\/Date(1458450000000-0500)\/","StartTimezone":null,"TaskID":"1","Title":"Full Name"},{"Description":"Full Name","End":"\/Date(1458450000000-0500)\/","EndTimezone":null,"IsAllDay":true,"OwnerID":"2","RecurrenceException":null,"RecurrenceID":null,"RecurrenceRule":null,"Start":"\/Date(1458450000000-0500)\/","StartTimezone":null,"TaskID":"2","Title":"Full Name"}]}

 

View model is the following, but it no works. What's wrong?.  Thanks so much for your help.

 

var viewModel = kendo.observable({
        isVisible: true,
        tasks: new kendo.data.SchedulerDataSource({
            batch: true,
            transport: {
                read: {
                    url: "http://xxx/RestServiceImpl.svc/json",
                    dataType: "json"
                },
                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" },
                        isAllDay: { type: "boolean", from: "IsAllDay" }
                    }
                }
            }
        })
    });

 
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Sorry for my writing . I'm trying to load a scheduler with a web service which returns the following:
Vladimir Iliev
Telerik team
 answered on 31 Mar 2016
6 answers
144 views

The legend colors are not matching the colors I have set for the individual series in my bar chart. I have read through several different forum topics that were supposed to have a  solution, but none of them seem to work. I am using hexadecimal web colors and assigning them to Series.Color as specified in "http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#configuration-series.color".   How can I CUSTOMIZE or SET the legend colors as well?  I have read the following forum topics, but neither solve the problem. 

 

http://www.telerik.com/forums/legend-color-change#Feo0EzBZ6E6jA3Ns-3WOjQ

http://www.telerik.com/forums/stack-bar-chart#HvKBqPuqP023kBLIQHAnrA

Daniel
Telerik team
 answered on 31 Mar 2016
13 answers
2.6K+ views
I'm using the 2014.2.909 nightly build and Angular-Kendo 1.03.  When I create a grid that has filtering, grouping, or column ordering, I get this when navigating away from the view:

TypeError: Cannot read property 'destroy' of undefined
at N.ui.DataBoundWidget.extend.destroy (http://localhost:1391/Scripts/kendo/2014.2.909/kendo.all.min.js:22:31285)
at http://localhost:1391/Scripts/angular-kendo.js:214:28
at Scope.$broadcast (http://localhost:1391/Scripts/angular.js:12887:28)
at Scope.$destroy (http://localhost:1391/Scripts/angular.js:12545:14)
at Scope.$delegate.__proto__.$destroy (<anonymous>:812:29)
at cleanupLastView (http://localhost:1391/Scripts/AngularUI/ui-router.js:2243:26)
at updateView (http://localhost:1391/Scripts/AngularUI/ui-router.js:2269:11)
at eventHook (http://localhost:1391/Scripts/AngularUI/ui-router.js:2224:17)
at Scope.$broadcast (http://localhost:1391/Scripts/angular.js:12887:28)
at $state.transition.resolved.then.$state.transition (http://localhost:1391/Scripts/AngularUI/ui-router.js:1822:22)
Detected Kendo UI version: "2014.2.909" 

I am not explicitly calling destroy, it is being handled by Angular or jQuery (I suspect the former since the grid is created via a Angular-Kendo directive).  I have a page with many grids like this in various tabs and when leaving the page, I end up flooding my error logging with this same error for each behavior on each grid that causes it.  I had suspected it was an issue with Angular-Kendo but the issue in that repo has been closed for a long time.  I read in this thread what seemed like a similar problem since all of the widgets decend from the same base but switching to the nightly build didn't change anything.  It does look like the widget is being destroyed by something, how do I get Kendo to stop trying to do it again?
Nikolay Rusev
Telerik team
 answered on 31 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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?