Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.8K+ views
Hi,

I am trying to get the start date and end date of the range that the user is viewing.

It seems that the 'date' method will only return the end date of the current view. How do I retrieve the start date?

var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.date()  // This is only the end date

Thanks

Zohar
Georgi Krustev
Telerik team
 answered on 03 Oct 2014
3 answers
133 views
I was looking for a configuration option for Window where I could change the text, aka messages config (much like I can change the text for paging, etc).  Specifically, I wanted to change the text associated with the close button in the titlebar of the window.

for example, the grid offers the config for:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-messages

If this is currently not available, is this somewhere on the horizon for Window?

Thanks,
--Ed
Kiril Nikolov
Telerik team
 answered on 03 Oct 2014
5 answers
203 views
I'm using kendoUpload control to upload the file. Everything works fine and fires success callback in IE10, Chrome and FF but as soon as I switch to IE8 and IE9 the browser freezes but the file is uploaded successfully and the success callback doesnt fire. 

Please help. Thanks in advance.

Code:  
================
HTML

 <div class="box-col" style="width: auto;">
                        <input id="files"
                               name="files"
                               type="file"
                               data-role="upload"
                               data-async="{ saveUrl: 'url/api/MyClass/UploadFiles', removeUrl: 'remove', autoUpload: true }"
                               data-localization="{select: 'Browse...'}"
                               data-bind="visible: isVisible,
                              enabled: enableFileUpload,
                              events: {
                                        select: documentFilename_OnSelected,
                                        success: upload_onSuccess,
                                        error: upload_onError
                                      }"
                               style="width:inherit;">

                    </div>

===========================================
JS:
var docLibItemKendoVM = kendo.observable({
            upload_onSuccess: function (e) {               
               console.log('success');
            },

            upload_onError: function (e) {
                console.log('error')
            },

            documentFilename_OnSelected: function (e) {
                console.log('selected');
            }
});





===================================================*/
WebAPI 

[Route("UploadFiles/{folderId}/{childId}")]
public async Task<JObject> PostUploadFiles(string folderId, int childId)
        {
             if (Request.Content.IsMimeMultipartContent())
            {
                JObject retVal;
                try
                {
                    retVal = JObject.FromObject(new
                    {
                        fileName = "Sample Name",
                        fullFileName = "Sample Path"
                    });
                    return await Task.FromResult<JObject>(retVal);
                }
                catch (Exception ex)
                {
                    retVal = JObject.FromObject(new
                    {
                        errorDetail = ex.Message
                    });
                    throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.InternalServerError, retVal));
                }
            }
            else
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotAcceptable, "Invalid Request!"));
            }
        }






























Dimiter Madjarov
Telerik team
 answered on 03 Oct 2014
4 answers
174 views
Hi everyone

I am trying to get a line model, with grouped line items. I am not getting an error, but its say undefined on the labels etc. I am pretty sure I am 99% there.
View:
[code]
@model NBSDashboard.Models.StoreReportNominalResultModel
<div class="centered">
@(Html.Kendo().Chart(Model.LineChartDataDecimalList)
.Name("ASPLineChart")
.DataSource(dataSource => dataSource
.Read(read => read.Action("NominalStoreLineChartData", "Dashboard", new { valueType = 2, storeId = Model.Stores.SelectedStoreId, showChart = Model.ShowASP }))
.Group(group => group.Add(model => model.Element))
.Sort(sort => sort.Add(model => model.TransactionDate).Ascending())
)
.Series(series =>
{
series.Line(model => model.Value)
.Name("#= group.value #");
})
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels
.Format("R {0}")
.Skip(2)
.Step(2)
)
)
.CategoryAxis(axis => axis
.Categories(model => model.TransactionDate)
)
)
</div>
[/code]
Controller:
[code]
        public ActionResult NominalStoreLineChartData([DataSourceRequest] DataSourceRequest request, int valueType, int storeId, bool showChart)
        {
            if (showChart)
            {
                        return Json(LineChartDecimalValue(valueType, storeId).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
            }
            else
                return null;
        }

        /// <summary>
        /// Generate DataSet For Nominal Report Line Chart With Decimal Values
        /// </summary>
        private IEnumerable<LineChartDataDecimal> LineChartDecimalValue(int valueType, int storeId)
        {
            var dt = _bookscanService.GetNominalStoreLineChartData(1000, storeId, valueType);

            return (from DataRow row in dt.Rows
                    select new LineChartDataDecimal
                    {
                        Element = row["Element"].ToString(),
                        TransactionDate = DateTime.Parse(row["TransactionDate"].ToString()),
                        Value = decimal.Parse(row["Value"].ToString()),
                    }).ToList();
        }
[/code]
I have attached some sample data. I am expecting to see the the Value line over the TransactionDate period, grouped by each Element?

The actual model used, doesn't carry the information though? Its just a representation of how the data looks?

I am confused as the model wont be populated with data, the AJAX call brings back List<LineChartDataDecimal> and I just want to use that?


Hristo Germanov
Telerik team
 answered on 03 Oct 2014
3 answers
144 views
I'm refreshing my dataSource by calling dataSource.read(). But  I'm getting strange crashes inside kendo internals if this happens when the user is dragging an event.

"Cannot read property 'update' of undefined"
"TypeError: Cannot read property 'update' of undefined
    at Widget.extend._updateEvent.updateEvent (http://localhost:64767/Scripts/kendo/kendo.all.js:75279:26)
    at Widget.extend._updateEvent (http://localhost:64767/Scripts/kendo/kendo.all.js:75347:17)
    at null.<anonymous> (http://localhost:64767/Scripts/kendo/kendo.all.js:75093:34)
    at Class.extend.trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:179:33)
    at Widget.extend._trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:14791:25)
    at Widget.extend._end (http://localhost:64767/Scripts/kendo/kendo.all.js:14769:18)
    at jQuery.extend.proxy.proxy (http://localhost:64767/Scripts/jquery-1.10.2.js:841:14)
    at Class.extend.trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:179:33)
    at Observable.extend.notify (http://localhost:64767/Scripts/kendo/kendo.all.js:13816:25)
    at Class.extend._trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:13662:32)"
Is there anything I do to detect when the user is performing a drag?

Cheers, Paul.
Alexander Popov
Telerik team
 answered on 03 Oct 2014
4 answers
1.6K+ views
Hi to all,

I am using your datasource for accessing an odata service. I am changing the filter when the selected row of a grid changes.
Therfore I am using the ds.filter() method.
When I check the traffic to the http endpoint via fiddler I have seen that just setting the filter fires a request to the server.
OK I thought, lets spare out the fetch method and consume the data right after setting the filter because the request has been implicitly made by the filter method.
But the data has not been updated, this is because the request will be made async I think...

So I have to call fetch and use a callback to be in sync with the request\response.

Is it possible to supress the request when setting the filter via filter() method? Otherwise these request will be made twice on every change...

--- init of data source
if (t.quickViewDataSource == null) {
                console.log("init quick view data source...");
                t.quickViewDataSource = new kendo.data.DataSource({
                    type: "odata",
                    transport: {
                        read: {
                            url: "https://someone.com/fis/odata/mydata",
                            dataType: "json"
                        }
                    },
                    sort: { field: "Released", dir: "desc" },
                    schema: {
                        data: function(data) {
                            return data.value;
                        },
                        total: function(data) {
                            return data["odata.count"];
                        },
                        errors: function(data) {

                        },
                        model: {
                            fields: {
                                FlightId: { type: 'number', nullable: false },
                                InfoType: { type: 'string' },
                                Displayname: { type: 'string' },
                                Title: { type: 'string' },
                                Released: { type: 'datetime', nullable: false },
                                Size: { type: 'number' },
                                DbTimeStamp: { type: 'datetime', nullable: false },
                                Format: { type: 'string' },
                                Identifier: { type: 'string', nullable: false },
                                OfpAltnNo: { type: 'number' }
                            }
                        }
                    },
                    filter: {
                        logic: "and",
                        filters: [
                            { field: "FlightId", operator: "eq", value: -1 },
                            { field: "InfoType", operator: "eq", value: "X" }
                        ]
                    },
                    pageSize: 1,
                    serverPaging: true,
                    serverFiltering: true,
                    serverSorting: true
                });
                t.quickViewDataSource.fetch();
            }

--- code that uses the datasource
...
var dataItem = t.mainGrid.dataItem(selected);
                var flightId = dataItem.Id;

                t.quickViewContent("LOADING...");

                t.quickViewDataSource.filter(
                    [
                        { field: "FlightId", operator: "eq", value: flightId },
                        { field: "InfoType", operator: "eq", value: type }
                    ]
                );

               t.quickViewDataSource.fetch(function () {
                    var rows = t.quickViewDataSource.data();
                    if (rows.length > 0) {
                        var row = rows[0];
                        
                        var dataUri = t.globals.baseUriBinaryData + row.Identifier;
                        $.get(dataUri).done(function(data) { t.quickViewContent(data); }).fail(function(error) { t.quickViewContent("failed to load data from server: " + error); });
                    } else {
                        t.quickViewContent("NO DATA AVAIABLE");
                    }
                });
Kiril Nikolov
Telerik team
 answered on 03 Oct 2014
2 answers
136 views
Hello

I cannot seem to group my stores together on x-axis who all fall within a province while also having two values per store( current and previous year values).

Help much appreciated.

@(Html.Kendo().Chart(Model.BarChartDataVAL)
                    .Name("VALBarChart")
                    .Theme("Silver")
                   
                    .ChartArea(chartArea => chartArea
                    .Background("#f2f2f2")
                    )
                    .Series(series =>
                    {
                        series.Column(model => model.PreviousValue).Tooltip(tooltip => tooltip
                            .Visible(true)
                            .Template("#=dataItem.Element#: Previous Year R #= kendo.toString(value,'n2') #"));
                        series.Column(model => model.Value).Tooltip(tooltip => tooltip
                            .Visible(true)
                            .Template("#=dataItem.Element#: R #= kendo.toString(value,'n2') #"));
                    })
                    .Legend(legend => legend
                        .Visible(true)
                        .Position(ChartLegendPosition.Top)
                    )
                    .CategoryAxis(axis => axis
                        .Categories(model => model.Province).Labels(labels => labels.Rotation(270))
                        .AxisCrossingValue(0)
                     )
                    .ValueAxis(axis => axis.Numeric()
                    .Labels(labels => labels
                    .Format("R {0:n2}")
                    .Skip(2)
                    .Step(2)
                    )
                ))
Hristo Germanov
Telerik team
 answered on 03 Oct 2014
2 answers
1.4K+ views
Hello,

I was going through the context menu example
http://demos.telerik.com/aspnet-mvc/menu/context-menu

and i would like to show context menu on kendo grid instead. So on view where i have kendo grid i am adding the following code
@(Html.Kendo().ContextMenu()
        .Name("menu")
        .Target("#Grid")
        .Orientation(ContextMenuOrientation.Vertical)
        .Animation(animation =>
        {
            animation.Open(open =>
            {
                open.Fade(FadeDirection.In);
                open.Duration(500);
            });
        })
        .Items(items =>
        {
          
            items.Add()
                 .Text("Forward");

            items.Add()
                .Text("Mark as")
                .Items(children =>
                {
                    children.Add().Text("Unread");
                    children.Add().Separator(true);
                    children.Add().Text("Important");
                    children.Add().Text("Read");
                });

           
        })
    )
But it does not display any context menu. What am i doing wrong. Do i need more than a target to say where the context menu will be displayed?

Anamika
Dimiter Madjarov
Telerik team
 answered on 03 Oct 2014
1 answer
120 views
I've created a repro case here:

http://dojo.telerik.com/Ewev

Grab the top resize handle of 'Call charlie about the project' and pull it off the top of the scheduler. It crashes with this callstack:

"TypeError: Cannot read property 'element' of null
    at that._resizeDraggable.kendo.ui.Draggable.dragend (http://localhost:64767/Scripts/kendo/kendo.all.js:75249:46)
    at Class.extend.trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:179:33)
    at Widget.extend._trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:14791:25)
    at Widget.extend._end (http://localhost:64767/Scripts/kendo/kendo.all.js:14769:18)
    at proxy (http://localhost:64767/Scripts/jquery-1.10.2.js:841:14)
    at Class.extend.trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:179:33)
    at Observable.extend.notify (http://localhost:64767/Scripts/kendo/kendo.all.js:13816:25)
    at Class.extend._trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:13662:32)
    at Class.extend.end (http://localhost:64767/Scripts/kendo/kendo.all.js:13610:22)
    at Observable.extend._eachTouch (http://localhost:64767/Scripts/kendo/kendo.all.js:13936:46)"

Hope you can reproduce it :)

Cheers, Paul.
Vladimir Iliev
Telerik team
 answered on 03 Oct 2014
1 answer
144 views
I am caught in a no-man's-land: company wants to use HTML5 widgets for data-entry because HTML5 is "cutting edge" but the data-entry requirements are quite extensive, so that "mobile-first" UI metaphors are often not suitable. What we really need is "tablet first". For example, we have to track things like all of the states where a certain entity is licensed to practice, or all of the techniques in which a certain provider has been trained, and there could be dozens of possible values to display. Scrolling is not always the optimal UI solution. On the desktop, we have a "multi-checkbox-list" pane with several columns of values (example below). It is not unusual that at least 50% of the boxes are checked for a given entity.  Is there a kendo widget that could be programmed to have this multi-column checklist behavior? With such a widget we could take advantage of real-estate on tablets in horizontal orientation.

[  ]  this is item 1    [  ]   this is item 2          [x] this is item 3
[x]  this is item 4    [  ]   this is item 5          [x] this is item 6
[x]  this is item 7    [x]   this is item 8          [  ] this is item 9
[  ]  this is item10   [ ]   this is item11          [x] this is item 12
[x]  this is item13   [x]   this is item14         [x] this is item15
[  ]  this is item16   [x]   this is item17         [x] this is item18
[x]  this is item19   [x]   this is item20         [x] this is item21
[  ]  this is item22   [x]   this is item23         [  ] this is item24
[x]  this is item25   [x]   this is item26         [x] this is item27
<snip>.
[  ]  this is item28   [x]   this is item29           [x] this is item30
Petyo
Telerik team
 answered on 03 Oct 2014
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
Drag and Drop
Map
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?