Telerik Forums
Kendo UI for jQuery Forum
1 answer
111 views

Hi,

I have a scheduler which by default loads with month view showing (as per requirements) with the current date showing by default.  However, if a date is passed in via the querystring, I want it to load as day view instead and navigate to that date.  I have figured out how to change the selected date, but I can't get it so change the initial view based on this variable - how can I achieve this?  I've added my code below.

Thanks, Mark

=== DEFINITION OF SCHEDULER ===

@{
    //Get the initial scheduler date from the URL
    DateTime schedulerInitDate = DateTime.Today; 
    if (Request.QueryString["date"] != null && Request.QueryString["date"].Length == 8)
    {
        string strQueryStringDate = Request.QueryString["date"];
        string dayPart = strQueryStringDate.Substring(0, 2);
        string monthPart = strQueryStringDate.Substring(2, 2);
        string yearPart = strQueryStringDate.Substring(4, 4);
        schedulerInitDate = new DateTime(int.Parse(yearPart), int.Parse(monthPart), int.Parse(dayPart), 0, 0, 0);
    }
 }​

@( Html.Kendo().Scheduler<DiaryItemViewModel>()
    .Name("diary")
    .Editable(false)
    .Date(schedulerInitDate)   // sets the initial date for when it loads as today - in month view this takes you to current month, week view to current week etc.
    .StartTime(new DateTime(2015, 6, 1, 7, 00, 00))  // sets the start time in day view - 1/6/2015 is arbitrary here, could be any date!
    .EndTime(new DateTime(2015, 6, 1, 19, 00, 00))   // sets the end time in day view - 1/6/2015 is arbitrary here, could be any date!
    .EventTemplate("<div title='#= title #'>" +
                        "<div class='k-event-template' style='width:100%; margin-bottom:6px;'><span style='font-weight: bold;'>#= title #</span></div>" +
                        "#if(Confirmed) {#<div class='k-event-template' style='width:100%; margin-bottom:6px;'><img src='/Content/images/icons/calendar.png' /> Appointment Confirmed</div>#" +
                        "} else {#<div class='k-event-template' style='width:100%; margin-bottom:6px;'><img src='/Content/images/icons/calendar-grey.png' /> Appointment Unconfirmed</div>#}#" +
                        "<div class='k-event-template' style='width:100%; margin-bottom:6px;'>#= Reference #</div>" +
                        "<div class='k-event-template' style='width:100%; margin-bottom:6px;'><span style='font-weight: bold;'>Visit By:</span> #= VisitBy #</div>" +                 
                    "</div>")
    .Views(views =>
    {
        views.MonthView();
        views.WeekView();
        views.DayView();
    })
    .Timezone("Etc/UTC")
    .DataSource(d => d
        .ServerOperation(true)
        .Read(read => read.Action("GetAppointments", "Diary").Data("getAdditionalData"))
    )
    .Resources(resource =>
    {
        resource.Add(m => m.Title)
        .Title("Type")
        .DataTextField("Title")
        .BindTo(new[] { 
                        new { text = "General", value = "General", color = "#ffffff" } ,
                        new { text = "Legionella", value = "Legionella", color = "#000000" } ,
                        new { text = "Survey", value = "Survey", color = "#cccccc" } 
                    });
    })
    .Events(e => e
        .DataBound("onSchedulerOpen")
    )
)

 

==== JAVASCRIPT I AM TRYING TO USE TO SWITCH VIEW ON PAGE LOAD - BUT JUST RENDERS EMPTY PAGE ====

    // setup the page
    $(document).ready(function () {

        // set to day view in the diary if a certain date has been passed in via querystring
        if (....) {
            var scheduler = $("#diary").data("kendoScheduler");
            scheduler.view("day");
        }
    })​

Vladimir Iliev
Telerik team
 answered on 30 Jul 2015
1 answer
68 views

Hi , is it better to configure the kendo component using k-options in the angular controller or within the html.

is there any advantage./disadvantage to either?

 

thank you.

 

Kiril Nikolov
Telerik team
 answered on 30 Jul 2015
1 answer
2.3K+ views
H​i,

When using kendo-drop-down-list with ​AngularJs the DropDownList does not take the value of ng-model associated. In addition, the ng-model is modified by the dropdownlist value and takes as the first entry in the list:

  <select id ='ddl_general_qualite' kendo-drop-down-list k-ng-model = "mvEdit.CodeQualite"  k-data-source = "Qualite"  k-data-value-field = "' Code '" k-data-text-field = "'Libelle'"> </ select>


Do you have a solution for the drop down list as well take the value of the selected value ng-model?

thanks.
Plamen Lazarov
Telerik team
 answered on 30 Jul 2015
15 answers
248 views
Hello,

I have the problem with Pivot Grid with multiples Fields in columns and rows when expand the column, because when expand the columns after the rows, the pivot grid do a javascript exception and don't working more.

I attached files with scenarios that html file and Json Data, and please you look the video with steps of the error: http://screencast.com/t/QMNo5zuVkg

thanks
Georgi Krustev
Telerik team
 answered on 30 Jul 2015
1 answer
123 views

This is the bug: http://screencast.com/t/djgiG4OBa

Kendo.all.js focusTable function is the beginning of the problem. We worked through
from there to identify where the problem is Lines :62024-62026

We commented these lines out and then the bug been fixed. 
//else {
// table[0].focus(); //because preventDefault bellow, IE cannot focus the table alternative is unselectable=on
//}

Hope this feedback can make your product better.

Alex Gyoshev
Telerik team
 answered on 30 Jul 2015
0 answers
171 views

my Kendo Splitter is as below.

@(Html.Kendo().Splitter()
      .HtmlAttributes(new { style = "height:590px;", id = "mainSplitter" })
      .Orientation(SplitterOrientation.Horizontal)
      .Panes(horizontalPanes =>
      {
          horizontalPanes.Add()
              .HtmlAttributes(new { id = "left-pane" })
              .Size("246px")
              .Collapsible(true)
              .Content(@<text></text>);
          horizontalPanes.Add()
              .HtmlAttributes(new { id = "right-pane", style = "overflow:hidden;" })
            .Content(@<iframe id="tabsContent_iframe" src='' data-src='' style="width:100%;height:100%;"></iframe>
            );
      })
)

I have a button outside the splitter used to toggle the left-pane which worked perfectly.
Now, if I used the same button inside my iframe and make the call. It doesn't work.
I tried doing it in couple of ways as below:

1)

 

var parentSplitterId = parent.$('#mainSplitter').data("kendoSplitter");
 var parentLeftTogglePane = parent.$('#full-pane');// , window.parent.document);
   parentSplitterId[parentLeftTogglePane.width() > 0 ? "collaspe" : "expand"](parentLeftTogglePane);

2)

 

var parentSplitterId = window.parent.document.getElementById('mainSplitter');
var parentLeftTogglePane = $('#full-pane', window.parent.document);
var splitter = $("#parentSplitterId").data("kendoSplitter");
splitter[leftTogglePane.width() > 0 ? "collaspe" : "expand"](leftTooglePane);

 

I am not able to understand where I am going wrong or what I'm missing. Please guide me out here.
Thanks​​​

sandeep9164262326
Top achievements
Rank 1
 asked on 30 Jul 2015
1 answer
458 views

I created a demo based on standard dropdown MVVM demo which shows the behavior. For some reason DropDownList ​doesn't set it's value binding destination in case data-value-field attribute is not present. If you uncomment my attribute

comment-data-value-field="ProductID"

​example works fine.

But it took me a while to figure out what's missing there. I can't understand why I must specify data-value-field even though I set data-value-primitive="false", so data-value-field isn't used in any case. Documentation also says that dataValueField could be absent.

 

Plamen
Telerik team
 answered on 30 Jul 2015
26 answers
2.7K+ views

First off I'd just like to say how wonderful KendoUI is.  I got it working on my site in a matter of minutes thanks to your great docs and demos.

One thing I can't figure, and maybe I missed something obvious.  I find it easy enough to set one of the inlcuded CSS styles, and I can insert the style selector drop box with <select id="skinSelector" class="skinSelector"></select>

 So how do I populate it with the available styles such as you have in most of your demos?

Thanks.

 

mark
Top achievements
Rank 1
 answered on 29 Jul 2015
2 answers
1.7K+ views
Hello,

is is possible to hide the input TextBox of the Kendo UI DatePicker to only show the button which opens the date selection?

Best regard
Vaibhav
Top achievements
Rank 1
 answered on 29 Jul 2015
1 answer
200 views

I have an MVVM application using Kendo Grid, and I want to display hierarchy (nested grid). I am not able to display the hierarchy data. How can I get the hierarchy records to display?  

cshtml code:

<div id="custOrderGrid"
        data-role="grid"
        data-resizable="false"
        data-navigatable="true"
        data-editable="true"
        data-pageable="false"
        data-scrollable="true"
        onscroll="true"
        data-detail-template="child-template"
        data-columns="[
                { 'field': 'OrderID', 'title': '<b>Order #', 'width': 65 },
                { 'field': 'LineNo', 'title': '<b>Line Number', 'width': 65 },
                { 'field': 'ItemNo', 'title': '<b>Item Number', 'width': 65 },
                { 'field': 'Desc', 'title': '<b>Description', 'width': 150 }
            ]"
        data-bind="source: orderSearchResults"
        style="height: 55%">
</div>
 
<script id="child-template" type="text/x-kendo-template">
    <div data-role="grid"
         data-bind="source: obj2"
         data-columns="[
    { field: 'name' },
    { field: 'oid' }
    ]"></div>
</script>

 

typescript code

orderSearchResults = new kendo.data.DataSource({
    schema: {
        model: {
            id: "OrderID",
            fields: {
                LineNo: { type: "string" },
                ItemNo: { type: "string" },
                Description: { type: "string" }
            }
        }
    },
            data: [
                {
                    OrderID: "L44ZX4", LineNo: "15", ItemNo: "*X1WCJH", Description: "CDF9X2XSB",
                    obj2: [{
                        name: 'a1',
                        oid: 1
                        },
                        {
                            name: 'b1',
                            oid: 2
                        },
                        {
                            name: 'c1',
                            oid: 3
                        }]
                }
            ]
        });

 

How can I get the hierarchy data to display?

 

Alexander Valchev
Telerik team
 answered on 29 Jul 2015
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
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
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?