Telerik Forums
Kendo UI for jQuery Forum
1 answer
98 views

Need to show google icons into gantt chart column to see the status of task. Here is my code!

var tasksDataSource = new kendo.data.GanttDataSource({
    data:DS,
        schema: {
            model: {
                id: "id",
                fields: {
                sr: { from: "sr", type: "number" },
                    id: { from: "id", type: "string" },
                    runtimes: { from: "runtimes"},
                    parentId: { from: "parentId", type: "string", defaultValue: null, validation: { required: true } },
                    start: { from: "start", type: "date", format: "{0:MM/dd/yyyy}" },
                    end: { from: "end", type: "date", format: "{0:MM/dd/yyyy}" },
                    diff: { from:"diff", type: "string" },
                    title: { from: "title", defaultValue: "", type: "string" },
                    summary: { from: "summary", type: "boolean" },
                    expanded: { from: "expanded", type: "boolean", defaultValue: true }
                },
                computedRuntimes: function() {if (this.runtimes == JSON.stringify({"included":true,"pending":true,"executed":false}) ) {

x.push("a");

}
if (this.runtimes == JSON.stringify({"included":true,"pending":true,"executed":true}) ) {
x.push("b");
}
if (this.runtimes == JSON.stringify({"included":false,"pending":false,"executed":true}) ) {
x.push("b");
}
if (this.runtimes == JSON.stringify({"included":true,"pending":false,"executed":true}) ) {
x.push("c");
}
return x;
}
            },
        }
    });

Viktor Tachev
Telerik team
 answered on 08 Nov 2017
5 answers
349 views
Is it anyway that display legend title or add legend title?
Marin Bratanov
Top achievements
Rank 1
Iron
 answered on 08 Nov 2017
1 answer
396 views

In a Kendo spreadsheet I can manually set which borders a cell should have, and the color using the Borders tool palette.  Suppose I change my mind and want to remove borders.  The palette does not appear to have a 'remove all borders' item.

Q: Is it possible to remove borders once added ?

Suggestion: A great addition to the Borders palette would be to add edge style (dotted, dashed, solid, etc) and thickness.  Additionally, if you could palettize (and add to API) all beloved CSS bordering features that would be even better.

Regards,

Richard

 

Ivan Danchev
Telerik team
 answered on 07 Nov 2017
1 answer
410 views

HI,
That was weird,
I am using VS 2015 to publish a web project to local drive.
Everything was good except kendo fonts were not included in the destination folders.

I am talking about:
Styles\images\kendoui.ttf

Styles\images\kendoui.woff

Styles\fonts\glyphs\KendoUIGlyphs.eot

Styles\fonts\glyphs\KendoUIGlyphs.ttf

Styles\fonts\glyphs\KendoUIGlyphs.woff

Styles\fonts\glyphs\WebComponentsIcons.eot
Styles\fonts\glyphs\WebComponentsIcons.ttf
Styles\fonts\glyphs\WebComponentsIcons.woff

I manually copied them to website destination folders and then they appeared on the page

Any thoughts?

Thank you 

 

Dimitar
Telerik team
 answered on 07 Nov 2017
4 answers
232 views

I'm trying to create an editor for a HierarchicalDataSource (remotely loaded as JSON). 

I'm using `kendo.bind($('#target'),kendo.observable({data: new kendo.data.HierarchicalDataSource(<..config...>)});` to bind a hierarchical datasource with 3 levels of depth (customer -> location -> stores) [as an example]. For each level, I have a separate template for each type of child. I have a dojo demonstrating a static version.

I have several issues:

  1. Using a HierarchicalDataSource means that even if all the data is loaded at once, the tree doesn't fully populate.
  2. Declaring custom fields for child nodes doesn't auto-populate populated child nodes 
  3. In the static `data: [...]` version, it is possible to load child collections by calling `datasource.data().at(i).load()`, but it must be called twice to display the template for the children 
  4. In the remote-datasource version, load() doesn't load the data in the custom child collection ("locations"), though it does populate the dataitem.children collection. 
  5. Binding the template to `data-bind="source: children"` results in an Invalid Template error in the static version
  6. Binding the same template from #5 to `data-bind="source: locations"` works, but error #3 occurs, and load() doesn't work when first called. 
In short: given a heterogenous hierarchical dataset, how do I display nested editors for each node and its (different to itself) children?
Plamen
Telerik team
 answered on 07 Nov 2017
8 answers
351 views

I'm using a kendoTooltip on a Listview with a custom content function set up like this:

return acontrol.kendoTooltip({
        width: 220,
        height: 280,
        position: "right",
        show: function(e) {},
        autoHide: false,

showAfter: 1000,

content: function(e) {},

hide: function(e) {}

}).data("kendoTooltip");

 

I have the autoHide set to false in the tooltip and am setting timeouts on the show function, mouseout, and mousenter of the tooltip itself in order to hide the tooltip after x amount of time, but when I move to the following element, it hides the tooltip anyway.  Putting e.preventDefault()) in the hide function prevents the timeout from hiding the tooltip, but it doesn't stop the tooltip from being hidden on moving to a different item in the listview, even though I see that the content function fires for the new listview item (the show function never does). I need the autoHide set to false as actually trying to work with any of the information within the tooltip is difficult without quickly moving the mouse into the tooltip. How can I work around this? My solution works fine if the tooltip has timed out when moving to the next item, but if the timeout has not expired, it hides it and doesn't display the new data retrieved.

 

 

 

Neli
Telerik team
 answered on 07 Nov 2017
1 answer
898 views

I want to use range to set a cells value to a date.

What is the date literal expression that can be used in range.value() ?

For example:

var book = $("#book").kendoSpreadSheet({}).data("kendoSpreadsheet");
var sheet = book.activeSheet();
 
sheet.Range("A1")
.value( ... what spreadsheet date literal goes here ...)
.format(kendo.spreadsheet.formats.date)
;

 

I have been able to use a formula to put a date value in the cell

var book = $("#book").kendoSpreadSheet({}).data("kendoSpreadsheet");
var sheet = book.activeSheet();
  
var dateTime = new Date ("10/31/2017 12:00:00 AM");
var dateMeth = "=DATE(" + dateTime.getFullYear() + "," + dateTime.getMonth() + "," + dateTime.getDay() + ")";
 
sheet.Range("A1")
.formula(dateMeth)
.format(kendo.spreadsheet.formats.date)
;

 

It works, but is ugly !

My actual problem is a little more complicated because I am doing this in a Razor based MVC view that has get the value from a DateTime field in the view model.  The spreadsheet 'construction' is too complicated for using MVC HtmlHelpers.

 

Veselin Tsvetanov
Telerik team
 answered on 07 Nov 2017
1 answer
185 views

I have a large grid with selectable rows that is polled to refresh data - I am noticing that the grid after selecting rows  when the refresh occurs the grid has detached Dom Tree - I think this is due to the select() keeping the last selected target in javascript 

I have created a dojo and attached a screen grab
from the screen grab you can see this detached dom tree has a retained size

How do I clear the retained Dom Tree?

https://dojo.telerik.com/elITE

 

Stefan
Telerik team
 answered on 07 Nov 2017
1 answer
525 views

Hi, 

Id like to "query" the data of a dataSource that is attached to a Grid, without actually applying the results.

Maybe its better to say, I want to execute a filter() to determine how many results match my search criteria without applying the filter results to the grid.

Im sure I could execute a filter, read the data from the view, then clear the filter, but that method just seems wrong.

Is such a thing possible?

Thanks,
Grant

Stefan
Telerik team
 answered on 07 Nov 2017
2 answers
214 views

Hi,

 

My scheduler is working until the moment i add resource grouping, it will throw this error:

kendo.all.js:5317 Uncaught TypeError: Cannot read property 'length' of undefined
    at r.sort (kendo.all.js:5317)
    at r._sortForGrouping (kendo.all.js:5403)
    at r.groupBy (kendo.all.js:5376)
    at r.group (kendo.all.js:5354)
    at Function.r.process (kendo.all.js:5525)
    at init._queryProcess (kendo.all.js:6941)
    at init._process (kendo.all.js:6931)
    at init.success (kendo.all.js:6683)
    at success (kendo.all.js:6610)
    at Object.ye.extend.read.n.success (kendo.all.js:5599)

 

The line that causes the error is:

group: { resources: ["Colleges"]},

 

My code and a sample of the datasource json response are below:

var tz = "Asia/Dubai";
    
    $(document).ready(function () {
        $("#scheduler").kendoScheduler({
            date: new Date(),
            selectable: true,
            editable: {
                template: $("#editor").html(),
                editRecurringMode: "dialog"
            },
            edit: function (e) {
                console.log(e.event);
                e.preventDefault();
                if(e.event.id!=0)
                {
                    url = '@Url.Action("Details", new { id = "id" })';
                    url = url.replace('id', e.event.id);
                }
                else
                {
                    var selectedStartDate = ("0"+(e.event.start.getDate())).slice(-2)  + "-" + ("0"+(e.event.start.getMonth()+1)).slice(-2) + "-" + e.event.start.getFullYear() + " " + ("0" + e.event.start.getHours()).slice(-2) + ":" + ("0" + e.event.start.getMinutes()).slice(-2);
                    var selectedEndDate = ("0"+(e.event.end.getDate())).slice(-2)  + "-" + ("0"+(e.event.end.getMonth()+1)).slice(-2) + "-" + e.event.end.getFullYear() + " " + ("0" + e.event.end.getHours()).slice(-2) + ":" + ("0" + e.event.end.getMinutes()).slice(-2);
                    url= '@Url.Action("Create")?startDate=' + selectedStartDate+'&endDate=' + selectedEndDate;
                    
                }
                window.location = url;
            },
            change: function (e) {
                $("#viewBTN").prop('disabled', (e.events==null || e.events.length!=1));
                canCancel = (e.events!=null && e.events.length==1);
                if (canCancel == true)
                    canCancel = canCancel && e.events[0].StatusID == @CarBookingStatusTypes.Approved.ToInt();
                if (canCancel == true)
                    canCancel = canCancel && e.events[0].FromDate > new Date();
                $("#deleteBTN").prop('disabled', !canCancel);
                $("#editBTN").prop('disabled', (e.events==null || e.events.length!=1));
 
                var canAttendTo = (e.events!=null && e.events.length==1);
                
                if (canAttendTo == true)
                    canAttendTo = canAttendTo && e.events[0].StatusID == @CarBookingStatusTypes.Pending.ToInt();
              
                $("#attendToBTN").prop('disabled', !canAttendTo);
                
            }
             
           , views: [
            {
                type: "day", showWorkHours: true, showWorkHours: true, workWeekStart: 7,
                workWeekEnd: 4
            },
            {
                type: "week", selected: true, showWorkHours: true, workWeekStart: 7,
                workWeekEnd: 4
            },
            "month"
           ],
             
            timezone: tz,  dataSource:{
                batch: false,
                serverFiltering: true,
                
                "type": "aspnetmvc-ajax",
                transport: {
                    read: {
                        url: "/CarBookings/GetAllBookings"
                        
                        , dataType: "json"
                        , data: function (e) {
                            var scheduler = $("#scheduler").data("kendoScheduler");
 
                            var result = {
                                FromDate: scheduler.view().startDate().toISOString(),
                                ToDate: new Date(scheduler.view().endDate().getTime() + ((23 * 60 * 60 * 1000) + (59 * 60 * 1000) + (59 * 1000)+ 999)).toISOString()
                                ,skip: scheduler.dataSource.skip(),
                                take: scheduler.dataSource.take(),
                                sort:scheduler.dataSource.sort(),
                                page:scheduler.dataSource.page()
                            }
 
                            return result;
                        }
                    },
                    destroy: {
                        url: "/OffenderSchedules/Delete",
                        dataType: "json"
                    }
                    , parameterMap: function (data, operation) {
                        console.log("operation:" + operation);
                        if (operation === "update" || operation === "create") {
                           
                            data.Start = kendo.toString(kendo.parseDate(data.Start), "G");
                            
                            data.End = data.Start;
                            
                            return JSON.stringify({ postedItem: data });
                           
                        } else if (operation === "read") {
 
                            
                            var scheduler = $("#scheduler").data("kendoScheduler");
                            var endDate = new Date(scheduler.view().endDate().getTime() + ((23 * 60 * 60 * 1000) + (59 * 60 * 1000) + (59 * 1000)));
 
                            if (data.filter === undefined) {
                                
                                data = $.extend({
                                    filter: {
                                        logic: "and",
                                        filters: [
                                                  { operator: "gte", field: "FromDate", value: kendo.toString(kendo.parseDate(scheduler.view().startDate()), "G") },
                                                  { operator: "lte", field: "ToDate", value: kendo.toString(kendo.parseDate(endDate), "G") }
                                        ]
                                    }
                                }, data);
                            }
                            else if (data.filter.filters === undefined) {
                                
                                data = $.extend({
 
                                    filters: [
                                              { operator: "gte", field: "FromDate", value: kendo.toString(kendo.parseDate(scheduler.view().startDate()), "G") },
                                              { operator: "lte", field: "ToDate", value: kendo.toString(kendo.parseDate(endDate), "G") }
                                    ]
                                }
                                , data.filter);
                            }
                            else {
                                 
                                data.filter.filters.push({
                                    logic: "and", filters: [
                                                    { operator: "gte", field: "FromDate", value: kendo.toString(kendo.parseDate(scheduler.view().startDate()), "G") },
                                              { operator: "lte", field: "ToDate", value: kendo.toString(kendo.parseDate(endDate), "G") }
                                    ]
                                });
 
                            }
                        }
                       
                        return data;
                        
                    }
                     
                }
                ,
                group: { resources: ["Colleges"]},
                resources: [
                    {
                        field: "collegeID",
                       
                        name: "Colleges",
                        
                         dataSource:[
                            { text: "Central Services", value: 5, color: "#6eb3fa" }
                           , { text: "College 2", value: 4, color: "#f58a8a" }
                        ],
                        title: "College"
                    }
                ],
                schema: {
                    parse: function (response) {
                       
                        for (var i = 0; i < response.Data.length; i++) {
                            if (response.Data[i].VehicleDisplayName == null)
                                response.Data[i]['Title'] = "To:" + response.Data[i].ToLocationText + ', Passengers:' +
                                    response.Data[i].CarBookingPassengersList;
                            else
                                response.Data[i]['Title'] = "#:" + response.Data[i].VehicleNumber + "," + response.Data[i].VehicleDisplayName + ",To:" + response.Data[i].ToLocationText + ',Passengers:' +
                                    response.Data[i].CarBookingPassengersList;
 
                        }
                         
                        return response;
                    },
 
                    data: "Data",
 
                    model: {
                        id: "ID",
                        fields: {
 
                            
                            ID: {
                                from: "ID",
                                type: "number"
                            },
                            collegeID: { from: "CollegeID",type: "number", nullable: true },
                            title: { from: "Title", validation: { required: true } },
                            start: { type: "date", from: "FromDate" },
                            end: { type: "date", from: "ToDate" },
                            
                            description: { from: "VehicleDisplayName" },
                            recurrenceId: { from: "RecurrenceID" },
                            recurrenceRule: { from: "RecurrenceRule" },
                            recurrenceException: { from: "RecurrenceException" },
                            isAllDay: { from: "IsAllDay" },
                            startTimezone: { type: "string", defaultValue: tz },
                            endTimezone: { type: "string", defaultValue: tz }                         
                        }
                    }
                },            
                sort:{ field:"FromDate",dir:"asc"}
                ,change: function(e)
                {
                     
                }
            }
        });
    });

 

datasource response sample:

{"Data":[{"CreatedByDriver":null,"ID":11,"ApprovalStatusID":null,"StatusID":526,"VehicleID":null,"VehicleNumber":null,"FromDate":"\/Date(1509393600000)\/","ToDate":"\/Date(1509485400000)\/","CreatedByID":"a5cc4472-055a-41f1-96ac-ae024f20869f","DateCreated":"\/Date(1509432711343)\/","LastUpdatedByID":null,"DateLastUpdated":null,"CreatedByName":"User1 ","LastUpdatedByName":null,"StatusName":"Pending","CollegeID":5,"CollegeName":"College 1","FromLocationID":5,"ToLocationID":4,"FromLocationName":"Central Services","FromLocationText":"Central Services","ToLocationName":"College 2","ToLocationText":"College 1","RecurrenceID":null,"RecurrenceRule":null,"RecurrenceException":null,"IsAllDay":false,"CarBookingComments":"I would need to book a car ","ApprovalComments":null,"Vehicle":null,"VehicleDisplayName":","CarBookingPassengersList":"","DriverID":null,"DriverName":null,"DriverAspNetUserName":null,"IsEmergency":true,"PassengerIDs":null,"CarBookingPassengerNames":[],"CreatedByCollegeName":null}]

 

Thanks

Madani

 

 

 

 

Jayaram Krishnan
Top achievements
Rank 1
 answered on 07 Nov 2017
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?