Telerik Forums
Kendo UI for jQuery Forum
1 answer
92 views
Hello,

I want to use a DataViz Chart (line chart or area chart) to display chronological data. It is necessary that the category axis covers a month from the beginning to the end. The baseUnit property will be set to "days".

The current month causes a problem: My application does not calculate any values in advance. Therefore, the chart hides all categories for dates in the future.

Is it possible to avoid this adjustment?
Iliana Dyankova
Telerik team
 answered on 25 Feb 2014
1 answer
1.0K+ views
I have a Kendo UI DataSource that works when I use fetch(), but when I use the exact same configurtation with read() it fails. This is a problem as I need to retrieve data more than once and I can't do that with fetch().

Here is the DataSource code - 

var FieldsDataSource = new kendo.data.DataSource({
transport: {
read: {
url: "../WebServiceAddress",
dataType: "json",
type: "POST",
contentType: 'application/json; charset=utf-8',
cache: false
},
parameterMap: function() {
return "{some mapping that has been confirmed to work}";
},
schema: {
data: function (data) {
if (data && data.d) {
//execution gets to here and stops
return data.d;
}
else {
return [];
}
},
}
 
});


Here is the code that calls the DataSource.read() function - function loadFields() {

FieldsDataSource.read(function() {
var data = this.data();
if (data.length > 0) {
 
for (var i = 0; i < data.length; i++) {
var dataitem = data[i].Key;
$("#" + dataitem + "_field").prop("checked", data[i].Value);
}
}
});
}


If I change "FieldsDataSource.read(function()" to "FieldsDataSource.fetch(function()" everything works, but that doesn't make sense as I was under the impressionthat read and fetch do the same thing the difference being fetch only gets data once.

What I do know is that the data is being returned from the server, I can see it in fiddler - but the execution stops in the schema section where I flagged it in my code sample.

Apologies if I am asking a really obvious question, but I'm very new to Kendo.
Rosen
Telerik team
 answered on 25 Feb 2014
2 answers
107 views
Hi guys,
I'm working with a kendo mvc grid
here it is

@(Html.Kendo().Grid<Entity>(Model)
        .Name("valueGrid")
        .ToolBar(commands => commands.Create())
        .Columns(columns =>
        {
            columns.Bound(c => c.DOMAINID);
            columns.Bound(c => c.CODE);
            columns.Bound(c => c.VALUE);
            columns.Command(command => { command.Edit(); command.Destroy(); });
        })
        .Sortable()
        .Scrollable()
        .DataSource(dataSource => dataSource       
        .Ajax()
        .ServerOperation(false)      
        .Model(m => m.Id(v => v.DOMAINID))
        .Update(update => update.Action("UpdateValue", "DomainValue"))
        .Create(create => create.Action("CreateValue", "DomainValue"))
        .Destroy(delete => delete.Action("DeleteValue", "DomainValue"))
     )
    )


and that's my controller

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult CreateValue([DataSourceRequest] DataSourceRequest request, Value domValue)
{
    if (ModelState.IsValid)
    {
        db.Values.Add(domValue);
        db.SaveChanges();
    }
    DataSourceResult result = db.Values.Where(v => v.DOMAINID == domValue.DOMAINID).ToDataSourceResult(request, ModelState);
    return Json(result);
}

The whole operation works fine, the only issue is that the grid display wrong values...

ex

grid with values (id: 5, name: test, value: test)

if I add a new object (6, trial, trial); the new object is correctly added to the database but the new object appears with the same values as the first one in grid (in this case with 5, test, test...

I attached 2 screenshots to better explain my issue.

Thanks
Fabio
Gaetano
Top achievements
Rank 1
 answered on 25 Feb 2014
3 answers
173 views
Ok, I have wore Google out searching for possible solutions so I hope you here can help me. It is something simple I am sure but I have spent a couple of days (no laughing) on this. All I get is "Loading" on trying to load a list view view from a JSON remote datasource...it works fine if I declare the data locally in the file. so here is the code and what is being returned in Fiddler:

     
<div data-role="view" data-title="Brokers" id="side-root">
     <ul id="lvBroker" data-role="listview" data-style="inset" data-source="brokers1" data-template="brokerTemplate">
     </ul>
 </div>
 
 <script id="brokerTemplate" type="text/x-kendo-template">
 <table>
   <tr>
     <td>
       #: data.LastName #, #: FirstName # <br/>ph: #: Phone #
     </td>
   </tr>
 </table>
    
 </script>
var brokers1 = new kendo.data.DataSource({
    transport: {
        read: {
            type: 'GET',
            url: 'http://website.com/api/brokers' + '/' + 1 + '/all',
            dataType: 'json'
            }
        }
    });
 
$(document).ready(function(){
    var app = new kendo.mobile.Application(document.body, {
        transition: "slide"
        //platform: "android"
    });
  // brokers1.fetch(function(){
  //  brdata = this.data();
  // });
});

Fiddler screenshot and loading screenshot attached.

Thanks much!
Richard



Kiril Nikolov
Telerik team
 answered on 25 Feb 2014
1 answer
93 views
Hi,

The ScrollView works fin on iOS devices but when i try it on Androids.  The page element can be moved in both horizontal and vertical direction; which is very strange for scrollable element.  Please check the link for more clarification:  https://app.box.com/s/4iutxf9uu7ul8vip4zbb

 What should I do to fix this behavior?
Alexander Valchev
Telerik team
 answered on 25 Feb 2014
5 answers
124 views
Hi, can I somehow figure out (in the close event or similiar) that cancel was clicked or that the actionsheet was closed without anything being selected? Or is the best approach to just set a variable somethingClicked = false before opening the sheet that I set to true in my data-action events and check for true/false in the close event?
Kiril Nikolov
Telerik team
 answered on 25 Feb 2014
1 answer
476 views
Here's my View.  I have enabled Popup editing, which works fine if I don't subscribe to the Change event.  

However, I need to show a Details window when someone clicks on a row.  

What seems to be happening is that my custom Edit and Delete buttons are triggering the Change event.  Is there any way to prevent that?  


@model IEnumerable<ITServiceApps.Application>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

    <div @*class="right"*@ style="width: 1200px; overflow-x: scroll;">

        @(Html.Kendo().Grid<ITServiceApps.Application>()
        .Name("grid")
//        .Columns(columns => columns.AutoGenerate(action => { action.Width = "100px"; }))
.Columns(columns =>
{
                    columns.Command(command => command.Edit()).Width(45).Visible(true);
                    columns.Command(command => command.Destroy()).Width(45).Visible(true);   
                              
                    columns.Bound(c => c.Name).Width(100);
                    columns.Bound(c => c.RecordOwner).Width(100);
                    columns.Bound(c => c.Name).Width(100);
                    columns.Bound(c => c.Type).Width(100);
                    columns.Bound(c => c.RecordOwner).Width(100);
                    columns.Bound(c => c.RecordOwnerSubstitute).Width(100);
                    columns.Bound(c => c.ValidationDate).Width(100);
                    columns.Bound(c => c.Description).Width(100);
                    columns.Bound(c => c.Details).Width(100);
                    columns.Bound(c => c.Access).Width(100);
                    columns.Bound(c => c.HotlinePhone).Width(100);
                    columns.Bound(c => c.HotlineEmail).Width(100);
                    columns.Bound(c => c.HotlineServiceHours).Width(100);
                    columns.Bound(c => c.StatusValidDateStart).Width(100);
                    columns.Bound(c => c.StatusValidDateEnd).Width(100);
                    columns.Bound(c => c.Status).Width(100);
                    columns.Bound(c => c.GovernanceClass).Width(100);
                    columns.Bound(c => c.ResponsibleDepartment).Width(100);
                    columns.Bound(c => c.DegreeOfStandardization).Width(100);
                    columns.Bound(c => c.DataPrivacyCompliance).Width(100);
                    columns.Bound(c => c.DataPrivacyDocumentsUrl).Width(100);
                    columns.Bound(c => c.CITSectorCompliance).Width(100);
                    columns.Bound(c => c.RationaleIfNotCITSectorCompliance).Width(100);
                    columns.Bound(c => c.SLARelevance).Width(100);
                    columns.Bound(c => c.SWOTAnalysisURL).Width(100);
                    columns.Bound(c => c.ApplicationLanguages).Width(100);
                    columns.Bound(c => c.DataCenter).Width(100);
                    columns.Bound(c => c.ServiceDeskLocation).Width(100);
                    columns.Bound(c => c.ApplicationManagementCenter).Width(100);
                    columns.Bound(c => c.RemarkApplicationManagementCenter).Width(100);
                    columns.Bound(c => c.Architecture).Width(100);
                    columns.Bound(c => c.VisibleExternally).Width(100);
                    columns.Bound(c => c.ConnectionProtocol).Width(100);
                    columns.Bound(c => c.ECCRelevance).Width(100);
                    columns.Bound(c => c.ECCNLAN).Width(100);
                    columns.Bound(c => c.NumberOfNamedUsers).Width(100);
                    columns.Bound(c => c.ApplicationManagementCenter1).Width(100);
                    columns.Bound(c => c.OperationsModel).Width(100);
                    columns.Bound(c => c.AWV).Width(100);
                    columns.Bound(c => c.UsableInSolution).Width(100);
                    columns.Bound(c => c.StandAloneApplication).Width(100);
                    columns.Bound(c => c.Middleware).Width(100);
                    columns.Bound(c => c.System).Width(100);
                    columns.Bound(c => c.Remarks).Width(100);
                    columns.Bound(c => c.AdditionalDocuments).Width(100);
                    columns.Bound(c => c.Categorization).Width(100);
                    columns.Bound(c => c.Number).Width(100);
                    columns.Bound(c => c.ReportingCountry).Width(100);
                    columns.Bound(c => c.DistinctApplication).Width(100);
                    columns.Bound(c => c.Level).Width(100);
                    columns.Bound(c => c.FunctionalDomain).Width(100);
                    columns.Bound(c => c.ResponsibleWTFunnel).Width(100);
                    columns.Bound(c => c.GlobalApp).Width(100);
                    columns.Bound(c => c.ListOfCountries).Width(100);    
                })
        
                
        .HtmlAttributes(new { style = "height: 380px;" })
        .Scrollable(scrolling => scrolling.Enabled(true))
        // .Groupable()
        .Sortable()
        .Selectable(selection => selection.Enabled(true))        
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(c => c.Id))                
            .Read(read => read.Action("Apps_Read", "ITDB"))
            .Update(update => update.Action("Update", "ITDB"))
            .Create(update => update.Action("Create", "ITDB"))
            .Destroy(update => update.Action("Delete", "ITDB"))   
         
            )
        .Resizable(resize => resize.Columns(true))
        .Filterable(filtering => filtering.Enabled(true))
        .Editable(e => e.Mode(GridEditMode.PopUp))
        .ColumnMenu(columnMenu => columnMenu.Enabled(true))   
        .Events(e => e.Change("onChange"))         
        
      )


@(Html.Kendo().Window().Name("Details")
    .Title("Application Details")
    .Visible(false)
    .Modal(true)
    .Draggable(true)
    .Width(800)
)

    </div>

<style scoped="scoped">
    .demo-section {
        width: 1100px;
    }

        .demo-section h3 {
            margin: 5px 0 15px 0;
            text-align: center;
        }

    .left {
        width: 220px;
        float: left;
        height: 100%;
    }

    .right {
        margin-left: 220px;
    }

</style>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/x-kendo-template" id="template">
    <div id="details-container">
        <!-- this will be the content of the popup -->
        ApplicationName: <input type='text' value='#= Name #' />

    </div>
</script>

<script type="text/javascript">

    var detailsTemplate = kendo.template($("#template").html());
    var windowObject;
    var Id;
    var grid;

    $(document).ready(function () {
        windowObject = $("#Details").data("kendoWindow");
    });

    function onChange(e) {
        e.preventDefault();

        grid = e.sender;
        var currentDataItem = grid.dataItem(this.select());
        Id = currentDataItem.Id;

        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));

        windowObject.refresh({
            url: "/ITDB/Details/" + Id
        });
        windowObject.open();
        windowObject.center();
    }

    var detailsTemplate = kendo.template($("#template").html());

    function showDetails(e) {
        e.preventDefault();

        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var wnd = $("#Details").data("kendoWindow");

        wnd.content(detailsTemplate(dataItem));
        wnd.center().open();
    }
    </script>
Vladimir Iliev
Telerik team
 answered on 25 Feb 2014
3 answers
155 views
Hello,

I would like to make employee schedule management function with kendo ui scheduler.

and I need to set up break times on each employee's schedule.

the shape of time graph should be like this

#
#
#
#
%  << Break time
%
#
#
#

any ideas?
thanks.


Atanas Korchev
Telerik team
 answered on 25 Feb 2014
1 answer
133 views
After uppgradering to 2013.3.1324 I got a problem with chrome flickering the entire page when for example a grid filter menu was showed, I noticed in kendo-common-min.css that this style was removed, it was the first style in the file before in my old version.

:-webkit-any(body):after {
    content: "";
    display: block;
    visibility: hidden;
    height: 0;
    font: 0/0;
    -webkit-transform: translateZ(0);
}

after adding this style again the flickering was fixed, so what's up with this? Is something wrong with my other styles is this suposed to work without this style? I dont get any flickering with chrome on the demos that run the same style file without this style

/John.
Kamen Bundev
Telerik team
 answered on 25 Feb 2014
1 answer
96 views
The Typescript interface for slider has an error as well.
It has:

value(): void;
value(value: string): void;

But should be:
value(): number;
value(value: number): void;
Hristo Germanov
Telerik team
 answered on 25 Feb 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
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?