Telerik Forums
Kendo UI for jQuery Forum
3 answers
743 views

Hi, I have a problem where calling the close method on a window with it's parent container set to "display:none;" will not close the overlay nor fire the close event.
I believe it should still close the overlay and fire the event even if it's not visible.

I know the kendo window supports animations, but not with a callback at the end.

You may take a look here: http://dojo.telerik.com/iwIVI/7

 

Dimo
Telerik team
 answered on 27 Apr 2016
1 answer
90 views

Hey,

I'm having some problems with creating events in Kendo. When I create event it calls server but it does not fill in start and end dates in my event view model.

public class EventVm : IGanttTask
{
    public int Id { get; set; }
    public int? ParentId { get; set; }
    public int OrderId { get; set; }
    public decimal PercentComplete { get; set; }
    public DateTime Start { get; set; }
    public DateTime End { get; set; }
    public string Title { get; set; }
    public bool Summary { get; set; }
    public bool Expanded { get; set; }
}

What I see in Request.Form is:

Request.Form["Start"] == "4/24/2016 12:00:00 AM"

What I suspect is going on is - date is in US format, while my server is in UK or PL and probably MVC does not want to deserialize this date correctly and puts '01/01/0001 00:00:00 AM' in my  object.

 

Can I somehow force kendo to put it in ISO format? Or specify format somehow? Or maybe I'm missing something completly different?

Hristo Valyavicharski
Telerik team
 answered on 27 Apr 2016
1 answer
97 views

When putting data inside kendo gantt and missing some fields, it can cause browser to hang for a long time and then fail to display the data corretly. That can happen in many sittuations, including, but not limitted to:

  • Not specifying start and end date for event
  • Not specifying start and end date for summary event
  • setting event to expanded even when event has no children
  • etc

I would expect many behaviours here, like throwing an error in javascript, using some default values, calculating possible values (in case of event with children), skipping incorrect values in specific context and so on. What I would not expect is for browser to end up in state where I cannot interact with page for few seconds (probably before chrome kills script that blocks page)

Hristo Valyavicharski
Telerik team
 answered on 27 Apr 2016
1 answer
145 views

I'm trying to get Gantt working. I've configured it to use server to perform read, create and update. It loads events correctly and displays them on screen. I can update them just  fine.

However when I try to create new event, I get CreateEvent method called, I create event on server side, fill in all data, initialize Id field and send it back to server, just as required in documentation and done in demo code. When I try to update this newly created event I get new Create event being called, instead of update.

I assume that this is because UI does not store Id I've returned from server correctly. Even though I return element with Id = 9, I can see in kedo dataSource.data() that one of the elements have Id = 0.

 

What am I doing wrong?

public ActionResult CreateEvent([DataSourceRequest] DataSourceRequest request, EventVm @event)
        {
            var tm = new ProjectTimelineVm();
            tm.Events.Add(@event);
            @event.Id = tm.Events.Max(e => e.Id) + 1;
            @event.Start = DateTime.Parse(Request.Form["Start"], System.Globalization.CultureInfo.InvariantCulture);
            @event.End = DateTime.Parse(Request.Form["End"], System.Globalization.CultureInfo.InvariantCulture);
            @event.OrderId = @event.Id;
            @event.Expanded = false;
            @event.Summary = false;
            return Json(new[] { @event }.ToDataSourceResult(request, ModelState));
        }

 

and client side configuration (note that EventVm has Id property and Id property is expected by model configuration, after page reload newly added event will work fine):

var gantt;
$(function () {
    gantt = $("#timelineGantt").kendoGantt({
        columns: [
            { field: "Id", title: "ID", sortable: true },
            { field: "title", title: "Title", sortable: true },
            { field: "start", title: "Start", format: "{0: yyyy-MM-dd hh:mm:ss}", sortable: true },
            { field: "end", title: "End", format: "{0: yyyy-MM-dd hh:mm:ss}", sortable: true }],
        snap: true,
        height: 500,
        showWorkDays: false,
        showWorkHours: false,
        views: [
            { type: "day" },
            { type: "week", selected: true },
            { type: "month" }],
        dataSource: {
            type: (function () {
                if (kendo.data.transports['aspnetmvc-ajax']) {
                    return 'aspnetmvc-ajax';
                } else {
                    throw new Error('The kendo.aspnetmvc.min.js script is not included.');
                }
            })(),
            transport: {
                read: { url: "/Record/Project/ReadEvent" },
                prefix: "",
                update: { url: "/Record/Project/UpdateEvent" },
                create: { url: "/Record/Project/CreateEvent" }
            },
            schema: {
                data: "Data",
                total: "Total",
                errors: "Errors",
                model: {
                    id: "Id",
                    fields: {
                        Id: { type: "number" },
                        parentId: { from: "ParentId", type: "number", defaultValue: null },
                        orderId: { from: "OrderId", type: "number" },
                        percentComplete: { from: "PercentComplete", type: "number" },
                        start: { from: "Start", type: "date", defaultValue: new Date(2016, 3, 25, 14, 42, 36, 959) },
                        end: { from: "End", type: "date", defaultValue: new Date(2016, 3, 25, 14, 42, 36, 959) },
                        title: { from: "Title", type: "string" },
                        summary: { from: "Summary", type: "boolean", defaultValue: false },
                        expanded: { from: "Expanded", type: "boolean", defaultValue: false }
                    }
                }
            },
        },
        dependencies: {
            type: (function () {
                if (kendo.data.transports['aspnetmvc-ajax']) {
                    return 'aspnetmvc-ajax';
                } else {
                    throw new Error('The kendo.aspnetmvc.min.js script is not included.');
                }
            })(),
            transport: {
                read: { url: "" },
                prefix: ""
            },
            schema: {
                data: "Data", "total": "Total",
                errors: "Errors",
                model: {
                    fields: {
                        Type: { type: "number" },
                        DependencyID: { type: "number" },
                        PredecessorID: { type: "number" },
                        SuccessorID: { type: "number" }
                    }
                }
            },
            data: {
                Data: [],
                Total: 0,
                AggregateResults: null
            }
        }
    }).data("kendoGantt");
});

Hristo Valyavicharski
Telerik team
 answered on 27 Apr 2016
1 answer
153 views

Hi,

I was trying to create a angular stock chart with multiple series but no data/series displayed on chart.  Here is the html and java script code.

Am I missing something in chart options ? Please help.

 

Html: 

<div kendo-stock-chart k-options="chartOptions" style="height:400px; width:870px;" ></div>

 

$scope.chartOptions = {
                             dateField: "DateTime",
                             valueAxis: [{
                                 labels: {
                                     format: {}
                                 }
                             }],
                             seriesDefaults: {
                                 type: "line",
                                 style: "smooth"
                             },
                             series: [{
                                 type: "line",
                                 style: "smooth",
                                 field: "KPIVALUE",
                                 name: "Jan 11 2014 12:00AM",
                                 tooltip: {
                                     visible: "true",
                                     template: "#=DateTime#-#=KPIVALUE#"
                                 },
                                 data: [{
                                     DateTime: "2014-01-11T00:00:00.000Z",
                                     DateTimeTicks: "1391212800000",
                                     KPINAME: "percent11",
                                     KPIVALUE: 99.904454,
                                     SeriesName: "Jan 11 2014 12:00AM"
                                 }, {
                                     DateTime: "2014-01-11T00:15:00.000Z",
                                     DateTimeTicks: "1391213700000",
                                     KPINAME: "percent11",
                                     KPIVALUE: 99.900868,
                                     SeriesName: "Jan 11 2014 12:00AM"
                                 }, {
                                     DateTime: "2014-01-11T00:30:00.000Z",
                                     DateTimeTicks: "1391214600000",
                                     KPINAME: "percent11",
                                     KPIVALUE: 99.861033,
                                     SeriesName: "Jan 11 2014 12:00AM"
                                 }, {
                                     DateTime: "2014-01-11T00:45:00.000Z",
                                     DateTimeTicks: "1391215500000",
                                     KPINAME: "percent11",
                                     KPIVALUE: 99.906269,
                                     SeriesName: "Jan 11 2014 12:00AM"
                                 }, {
                                     DateTime: "2014-01-11T01:00:00.000Z",
                                     DateTimeTicks: "1391216400000",
                                     KPINAME: "percent11",
                                     KPIVALUE: 99.91746,
                                     SeriesName: "Jan 11 2014 12:00AM"
                                 }]
                             }]
                         }

 

Daniel
Telerik team
 answered on 27 Apr 2016
3 answers
370 views
I am trying to get the AutoComplete control to work with a WCF method that takes in parameters, I did get the autocomplete control to work with a wcf method that does not have any parameters, but when I try to pass in parameters it won't work. My code is below:

    [ServiceContract]
    public interface IShippers
    {
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
        IEnumerable<Company> QueryDatabase(string columns, string table, string whereClause);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
        IEnumerable<Company> GetShippers();
    }

    [DataContract]
    public class Company
    {
        public Company(string id, string name)
        {
            Id = id;
            Name = name;
        }

        [DataMember]
        public string Id { get; set; }

        [DataMember]
        public string Name { get; set; }
    }

   [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class Shippers : IShippers
    {
        public IEnumerable<Company> QueryDatabase(string columns, string table, string whereClause)
        {
            List<Company> shippers = new List<Company>();

            try
            {
                var sql = string.Concat("select ", columns, " from ", table, " where ", whereClause);

                var drSql = ExecuteSql(sql);

                while (drSql.Read())
                {
                    shippers.Add(new Company(drSql.GetString(1), drSql.GetString(0)));
                }

                drSql.Close();

                return shippers;
            }
            catch (Exception ex)
            {
                var message = ex.Message;
                return null;
            }
        }

        private SqlDataReader ExecuteSql(string sql, bool useForXml = false)
        {
            const string connectionString = "Server=CLE-BWRENN;Database=TrucoCompany;Trusted_Connection=True;";

            if (useForXml)
                sql = string.Concat(sql, "FOR XML");

            SqlConnection cnSql = new SqlConnection(connectionString);
            cnSql.Open();

            SqlCommand cmSql = new SqlCommand(sql, cnSql);
            SqlDataReader drSql = cmSql.ExecuteReader(CommandBehavior.CloseConnection);

            return drSql;
        }

        public IEnumerable<Company> GetShippers()
        {
            List<Company> shippers = new List<Company>();

            var drSql = ExecuteSql("select cmp_name, cmp_id from company where cmp_shipper = 'y'");

            while (drSql.Read())
            {
                shippers.Add(new Company(drSql.GetString(1), drSql.GetString(0)));
            }

            drSql.Close();

            return shippers;
        }
    }

 <div id="AutoCompleteTest" class="k-content">
        <div id="Shipper">
            <input id="input" />
            <div class="hint">type shipper</div>
        </div>

        <script type="text/javascript">

            $(document).ready(function () {
                //$.ajax({
                //    type: "post",
                //    url: "http://localhost/WCFTest/Service1.svc/QueryDatabase",
                //    data: '{"columns":"cmp_name,cmp_id", "table":"company", "whereClause":"cmp_shipper = \'y\'"}',
                //    dataType: "json",
                //    contentType: "application/json; charset=utf-8",
                //    success: function(result) {
                //        debugger;
                //    },
                //    error: function (result) {
                //        debugger;
                //    }
                //});

                $("#input").kendoAutoComplete({
                    dataTextField: "Name",
                    template: "<span><b>${ data.Name }</b></span>&nbsp;<span>${ data.Id }</span>",
                    dataSource: {
                        minLength: 1,
                        type: "json",
                        schema: {
                            data: "d",
                        },
                        transport: {
                            read: {
                                url: "http://localhost/WCFTest/Service1.svc/QueryDatabase",
                                dataType: "json",
                                type: "POST"
                            },
                            parameterMap: function () {
                                var data = {
                                    columns: "cmp_name,cmp_id",
                                    table: "company",
                                    whereClause: "cmp_invcopies = 1"
                                };

                                return JSON.stringify(data);
                            },
                        }
                    },
                    filter: "startswith",
                    placeholder: "Select ...",
                    separator: ","
                });
            });
        </script>
        <style scoped="scoped">
            .k-autocomplete {
                width: 500px;
            }

            #AutoCompleteTest .k-autocomplete {
                width: 250px;
            }
        </style>
    </div>
Daniel
Telerik team
 answered on 27 Apr 2016
5 answers
385 views
Is there any way to check the status of the ctrl-key during a drop event?  I've tried monitoring the state of the ctrl key tracking the mouseup event in the treeview element but it doesn't fire when the drop is completed.  What I'm trying to accomplish is to only "copy" the node (rather than move it) if the user drags the node to another node when the ctrl key is held down.  
Kiril Nikolov
Telerik team
 answered on 27 Apr 2016
3 answers
155 views

Hi,

I have a grid with scrollable: { virtual: true }, pagesize: 25 setup with local data. I select a row and scroll away so paging happens, when I scroll back, and selection is lost. I saw other threads with suggested solution to do hacks around onChange and onDataBound event: http://jsbin.com/himuboxi/2/edit?html,output

My problem is, my grid is bound to local data, thus the DataBound event is fired when I scroll around. What other event could I depend on?

 

Best,

Ama

Kiril Nikolov
Telerik team
 answered on 27 Apr 2016
1 answer
134 views

Hi all,

I'm trying to save the current occurrence of the recurring event. But it cannot be saved, and I see the following error message in the console:

kendo.all.js:82119 Uncaught TypeError: Cannot read property 'isRecurrenceHead' of undefined

Could you please help me resolving it?

Kind Regards,

Georgi Krustev
Telerik team
 answered on 27 Apr 2016
1 answer
107 views

shapeMouseEnter and Leave events are sometimes called, but not always. To repeat this bug, just drag mouse over squares. Sometimes it is painted and sometime it is not.

dojo

T. Tsonev
Telerik team
 answered on 27 Apr 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?