Telerik Forums
Kendo UI for jQuery Forum
4 answers
214 views
In the following code, the button is wired to parse the value of the datepicker when clicked. It works fine until I try to enter the name of the month e.g. 15 juli 2015 will be converted to 2014-07-15. This means that the month and year are parsed correctly, whilst the year is not. The culture in this case is set to NL, but this also fails when using en-US with the date value July 15 2015.

<!DOCTYPE html>
<html>
<head>
    <style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
</head>
<body>
     
        <div id="example" class="k-content">
            <div id="email-settings">
                <div style="margin-top: -6px; margin-left: 180px">
                    <input id="datepicker" value="10/10/2011" style="width:150px;" />
                </div>               
              <div><button onclick="alert(kendo.parseDate($('#datepicker').val()));">Test</button></div>
            </div>
        <script>
            $(document).ready(function() {
                kendo.culture("nl-NL");
               
                // create DatePicker from input HTML element
                $("#datepicker").kendoDatePicker();
 
                $("#monthpicker").kendoDatePicker({
                    // defines the start view
                    start: "year",
 
                    // defines when the calendar should return date
                    depth: "year",
 
                    // display month and year in the input
                    format: "MMMM yyyy"
                });
            });
        </script>
        <style scoped>
            #example h2 {
                font-weight: normal;
            }
            #email-settings {
                width: 395px;
                margin: 30px auto;
                padding: 110px 0 0 30px;
                background: url('../../content/web/datepicker/mailSettings.png') transparent no-repeat 0 0;
            }
        </style>
        </div>
 
</body>
</html>
Beheer
Top achievements
Rank 1
 answered on 05 May 2014
1 answer
188 views
Hi,

I am copying the bulleted list from word to editor. Also I have few more code to strip the html in the paste event of the editor.

paste: function (e) {
                                        e.html = CleanWordHTML(e.html);
                }
 
function CleanWordHTML(str) {
    str = str.replace(/<br><br>/g, "");
    str = str.replace(/<br> /g, " ");
    str = str.replace(/<br>/g, " ");
    str = str.replace(/<o:p>\s*<\/o:p>/g, "");
    str = str.replace(/<o:p>.*?<\/o:p>/g, " ");
    str = str.replace(/(<(?!\/)[^>]+>)+(<\/[^>]+>)+/gi, '');
    str = str.replace(/<span[^>]*>[\s| ]*<\/span>/, '');
    str = str.replace(/\s*class="MsoNormal"/gi, '');
    str = str.replace(/<SPAN\s*[^>]*>\s* \s*<\/SPAN>/gi, '');
    str = str.replace(/<SPAN\s*[^>]*><\/SPAN>/gi, '');
    str = str.replace(/<span\s*[^>]*>\s* \s*<\/span>/gi, '');
    str = str.replace(/<span\s*[^>]*><\/span>/gi, '');
    str = str.replace(/\s*mso-[^:]+:[^;"]+;?/gi, "");
return str;
}


After pasting into the editor, when I see the source code, bulleted list is coming as paragraph instead of ul, li tag.

Is there anyway to convert word bulleted list to html bulleted list?

Suresh. 
Alex Gyoshev
Telerik team
 answered on 05 May 2014
1 answer
190 views
Trying to create a simple expand for details grid and the first column is not showing (the expand icon)

This is what I have on the view:

  <script id="upc_detail" type="text/x-kendo-template">
            @(Html.Kendo().Grid<PeriodicCheckWithLineage>()
                      .Name("upcgrid_#=Test_ID#")
                      .Columns(columns =>
                      {
                          columns.Bound(o => o.Date_Time).Title("Date/Time");
                          columns.Bound(o => o.IsND);
                          columns.Bound(o => o.IsSigShift);
                          columns.Bound(o => o.IsSigBias);
                      })
                      .DataSource(dataSource => dataSource
                          .Ajax()
                          .Read(read => read.Action("PeriodicDetail", "Review", new { TestID = "#=Test_ID#" }))
                      )
                      .ToClientTemplate())
        
        </script>

@(Html.Kendo().Grid<
TestLineage>(upc_test)
                    .Name("upcgrid")
                    .Columns(columns =>
                    {
                        columns.Bound(e => e.Lab_Name);
                        columns.Bound(e => e.Instrument_Name);
                        columns.Bound(e => e.Analyte_Name);
                        columns.Bound(e => e.Test_Name);
                    })
                   .ClientDetailTemplateId("upc_detail")
                    )

Chrome and IE show no JS errors. I have two other grids (no details or heirarchy) and they look fine. Not sure what I am doing wrong here.
Atanas Korchev
Telerik team
 answered on 05 May 2014
1 answer
117 views
hi,

i use grid on batch mode and i have a problem with the grid presentation when editing the grid.

The problem occurs when i create or remove another row while other fields are in changed mode and have the changed symbol (orange little triangle),
in this scenario, the  symbol is disappeared from the rows that were changed, although the changes has not been saved! .

This problem exists also in the demo grid on: 
http://demos.telerik.com/kendo-ui/web/grid/editing.html

To reproduce the problem:

1. Change one cell in the grid.
2. Move to other field and notice that the orange triangle appears.
3. Press on "Add new record" .
4. The orange symbol is disappeared !

can you advice how to solve the problem?

thanks,
Mali








Petur Subev
Telerik team
 answered on 05 May 2014
5 answers
517 views
I am giving option LTR and RTL text direction in Kendo Editor.

While clicking on particular icon, i have to get the selected area text and apply dir=rtl or dir="ltr" to the selected element. But i can able to get the selected text with the following code.

$(this).data("kendoEditor").getRange()

But i have to select the tag of this selected area and apply the direction attribute.

Can anyone help me to resolve this?
suresh
Top achievements
Rank 1
 answered on 03 May 2014
2 answers
983 views
It looks like by default creating a dataSource with a data array automatically loops through the entire array and does some operations on all of the members.  Is there a way to suppress this or have the reading of the elements controlled by a function?  I do not want the data source to access all of the members until it has a need to do so ... maybe this need is present and I'm just unaware of it.  I have an array that I want my data source to operate.  This array lazy loads its values at the time they are accessed.  I am giving this data source to a grid with a pager. I do not want my data source items to actually load until the pager / grid needs them for display.  Unfortunately I cannot use server side paging ... I must do this all through the client.  Can anyone think of some ways this can be accomplished, either through manipulating the data source and a pager, or maybe by mocking server side paging requests in the client?  Any help would be appreciated.  
Chris
Top achievements
Rank 1
 answered on 02 May 2014
2 answers
457 views
I write my codes in html is OK,but when I bind the datasource using javascript,it is not ok.What's wrong with my codes?

**My View:using Meetings_Read is OK,but using javascript is not OK**

     @(Html.Kendo().Scheduler<SchedulerCustomViewDemo.Models.SchedulerTest>()
    .Name("scheduler")
    .Date(new DateTime(2013, 6, 13))
    .StartTime(new DateTime(2014, 4, 13, 7, 00, 00))
    .Height(600)
    .Views(views => {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
        views.CustomView("kendo.ui.ToDoView", view => view.Title("To Do").Selected(true));
    })
    .DataSource(d => d
        .Events(e => e.Error("error_handler"))
    // .Read("Meetings_Read", "Home")
    )
    )

**My Javascript:it is not OK**

    $.ajax(
         {
             url: '@Url.Action("Meetings_Read","Home")',
               cache: false,
               async: true,
               success: function (result) {
                   var scheduler = $("#scheduler").data("kendoScheduler");
                   var dataSource = new kendo.data.SchedulerDataSource({
                        data: result.Data
                   });
                 scheduler.setDataSource(dataSource);
              }
         });

**My Model:can bind to the scheduler,but can not show the title**

       public class SchedulerTest: ISchedulerEvent
    {
        
        public string Description { get; set; }

        public DateTime End { get; set; }

        public string EndTimezone { get; set; }

        public bool IsAllDay { get; set; }

        public string RecurrenceException { get; set; }

        public string RecurrenceRule { get; set; }

        public DateTime Start { get; set; }

        public string StartTimezone { get; set; }
        public string Title { get; set; }
    }

**My Controller:just show the title of everyday in a month**

     public virtual JsonResult Meetings_Read([DataSourceRequest] DataSourceRequest request)
     {
     return Json(meetingService.GetAll().ToDataSourceResult(request));
     }
       public List<SchedulerTest> GetAll()
        {
            var firstDate = DateTime.Now.Date.AddDays(1 - DateTime.Now.Day);
            var lastDate = firstDate.AddMonths(1);
            var schedulerTests= new List<SchedulerTest>();
            int i = 0;
            for (; firstDate < lastDate; firstDate = firstDate.AddDays(1))
            {
                schedulerTests.Add(new SchedulerTest
                {
                    Title = firstDate.ToString("yyMMdd") + "abc",
                    Start = firstDate,
                    End = firstDate.AddDyas, 
                });
            }

            return schedulerTests;
        }
Jeff
Top achievements
Rank 1
 answered on 02 May 2014
1 answer
106 views
Hi, 

At first, I understood that the "onDataBound" event of the TreeView would indicate that my tree is "ready".
However, this is clearly not the case, and I'm wondering if there's nothing else I can use or if this is a known issue.

I use a hierarchical data and a transport/url to read the data (see code snippet below).
The OnDataBound event throws alright, but at this point in time, nothing can be done on the tree. Expanding items, looking for items. Nothing.
I currently put a 1500 millisecond timeout inside the OnDataBound and then call "expand" on the tree's first node... this which works most of the time - but not always, depending on the network.
Which means, the onDataBound is not even close to the event I need.
Is this expected/known or am I missing something here? Is there an event that I can use to indicate that the tree is ready (at the moment I just want to expand all nodes, eg -> tree.expand $("#treeName .k-item:first") and this doesn't work)

_treeViewDataSource = new kendo.data.HierarchicalDataSource(
  transport:
  read:
  url: options.dataUri
  dataType: "json" 
  data: postData
  cache: false
Alex Gyoshev
Telerik team
 answered on 02 May 2014
1 answer
93 views
I got a mvc grid with a popup editing feature. Inside my popup with is a mvc template I need a area do add child to a collection. I think I need a template but I don't know wow to implement it. The problem is that with this section the popup is invalid because in not part of the main model. How can i put this in the main template without making the popup invalid. I'm hiding and showing this area with javascript.
Thanks in advanced!!!

Rick.

Section to be in a template
~~~~~~

<div id="newPersonForm">
            <div class="container" id="personArea" style="display: none;">
                <div class="form-group">
                    @*<label class="control-label col-sm-3" for="ActivityPersonFirstName">Nombre </label>*@
                    @Html.TextBox("ActivityPersonFirstName", null, new { @class = "k-textbox", placeholder = "Nombre", style = "text-transform:capitalize;", required = "required" })
                    @Html.TextBox("ActivityPersonInitName", null, new { @class = "k-textbox", @placeholder = "Inicial", style = "text-transform:capitalize;"})
                </div>
                <div class="form-group">
                    @*<label class="control-label col-sm-3" for="ActivityPersonInitName">Inicial </label>*@
                    @Html.TextBox("ActivityPersonLastName1", null, new { @class = "k-textbox", @placeholder = "Apellido P", style = "text-transform:capitalize;", required = "required" })
                    @Html.TextBox("ActivityPersonLastName2", null, new { @class = "k-textbox", @placeholder = "Apellido M", style = "text-transform:capitalize;", required = "required" })
                </div>
                <div class="form-group">
                    @*<label class="control-label col-sm-3" for="ActivityPersonLastName1">Apellido P </label>*@
                    @Html.TextBox("ActivityPersonPhone1", null, new { @class = "k-textbox", @placeholder = "Telefono 1", required = "required" })
                    @Html.TextBox("ActivityPersonPhone2", null, new { @class = "k-textbox", @placeholder = "Telefono 2" })
                </div>
                <div class="form-group">
                    @*<label class="control-label col-sm-3" for="ActivityPersonLastName2">Apellido M </label>*@
                    @Html.TextBox("ActivityPersonSocSec", null, new { @class = "k-textbox", @placeholder = "Seguro Social", required = "required"})
                </div>
                <div class="form-group">
                    @*<label class="control-label col-sm-3" for="ActivityPersonSocSec">Seguro Social </label>*@
                    <a id="btnSometer" onclick="someter()" class="k-button">Someter</a>
                    <a id="btnCancelar" onclick="cancelar()" class="k-button">Cancelar</a>
                </div>
            </div>
        </div>
Petur Subev
Telerik team
 answered on 02 May 2014
2 answers
981 views
Hi,

Our datasources data are generated with nested objects from the server and sometimes, some values can be null.

At first, I had to do custom template functions for every column to display them according to their values, so I created a function that either returns the value of the object, or an empty string if on any given level, it is null. However, if I try filtering that column, an exception is thrown.

I have created a sample code to show this error, just try adding a filter to the column to see the error : http://jsfiddle.net/UXBcW/1/

Thanks
Petur Subev
Telerik team
 answered on 02 May 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?