Telerik Forums
UI for ASP.NET MVC Forum
2 answers
307 views

Hello,

I am having some trouble using custom callbacks for PasteCleanup, Deserialization or Serialization. Whatever input string I give as the custom callback, be it a function name or declaration, just gets double quoted in the editor configuration javascript that is generated and is then seemly ignored. Unlike how setting an event callback works.

How do I setup an editor to use these features?

Sample code:

@(Html.Kendo().Editor()
    .Name("bloop")
    .PasteCleanup(e => e.Custom("onPaste"))
    .Deserialization(e => e.Custom("onDeserialization"))
    .Serialization(e => e.Custom("onSerialization"))
    .Events(e => e.Change("onChange"))
)
 
<script type="text/javascript">
    function onPaste(html) {
        console.log('onPaste');
 
        return html;
    }
 
    function onSerialization(html) {
        console.log('onSerialization');
 
        return html;
    }
 
    function onDeserialization(html) {
        console.log('onDeserialization');
 
        return html;
    }
 
    function onChange() {
        console.log('onChange');
    }
</script>

 

Using that above code Html.Kendo().Editor() is generating the following javascript when it executes:

jQuery(function(){jQuery("#bloop").kendoEditor({"change":onChange,"deserialization":{"custom":"onDeserialization"},"pasteCleanup":{"custom":"onPaste"},"serialization":{"custom":"onSerialization"},"tools":[{"name":"formatting"},{"name":"bold"},{"name":"italic"},{"name":"underline"},{"name":"justifyLeft"},{"name":"justifyCenter"},{"name":"justifyRight"},{"name":"insertUnorderedList"},{"name":"insertOrderedList"},{"name":"outdent"},{"name":"indent"},{"name":"createLink"},{"name":"unlink"},{"name":"insertImage"},{"name":"createTable"},{"name":"addColumnLeft"},{"name":"addColumnRight"},{"name":"addRowAbove"},{"name":"addRowBelow"},{"name":"deleteRow"},{"name":"deleteColumn"}]});});

Note how onDeserialization is double quoted where onChange is not.

Using R2 2016 SP2 (2016.2.714) with MVC4.

Thank you

CWS
Top achievements
Rank 1
 answered on 12 Aug 2016
2 answers
153 views
In the editor, Is there a way to relocate the tool bar to the bottom left as opposed to the upper left?
Mark
Top achievements
Rank 1
 answered on 12 Aug 2016
10 answers
121 views

Hi,

the example http://demos.telerik.com/aspnet-mvc/financial/panes show how to plot the volume in a second pane.

How can I plot Line + Volume in one pane? Similar: http://finance.yahoo.com/chart/aapl

Peter

Peter
Top achievements
Rank 1
 answered on 11 Aug 2016
1 answer
183 views

I have a form with input text boxes, search button and grid to display the result. Once user clicks on Search button, the result get displayed in the grid. I have 10,20, 50, 100, All set as paging option in the grid. At first when the result gets displayed in the grid the paging value is 10. The issue is once the user selects different paging value e.g. 50 and perform search again, the result that get displayed in the grid is with paging value of 50. 

Is there anyway to reset paging value back to 10 again whenever new search is performed?

Thanks.

Avinash

Eyup
Telerik team
 answered on 11 Aug 2016
2 answers
188 views
Is it known that the editor  feature behaves differently in chrome for windows vs chrome for mac?
Mark
Top achievements
Rank 1
 answered on 11 Aug 2016
1 answer
82 views

How to localize  in french  create event popup ?

Please see attached file, i would like have title in french :

Event ==>  Evenement

None ==>  aucun

Time ==>  heure

Here is my code

@(Html.Kendo().Scheduler<TaskViewModel>()
                .Name("schedule")
                .Date(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
                .StartTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 00, 00))
                .EndTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 18, 00, 00))
                .HtmlAttributes(new { @class = "ra-section" })
                .Views(views =>
                {
                    views.DayView(dayView => dayView.Selected(true));
                    views.WeekView();
                    views.MonthView();
                    views.AgendaView();
                })
                .Editable(true)
                .Timezone("Etc/UTC")
                .DataSource(dataSource => dataSource
                .Model(m =>
                {
                    m.Id(f => f.TaskID);
                    m.Field(f => f.Title);
                    m.Field(f => f.Start);
                    m.Field(f => f.End);
                    m.Field(f => f.EndTimezone);
                })
                .Events(e => e.Error("error_handler"))
                .Read("ChargerTous", "TaskScheduler")
                .Create("Ajouter", "TaskScheduler")
                .Update("Modifier", "TaskScheduler")
                .Destroy("Supprimer", "TaskScheduler")
                )

 

Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
1 answer
151 views

Hello Support,
Columns and Rows are not displayed when the Spreadsheet Control is placed inside a Panel Bar.
The spreadsheet control crashes with missing references when clicking on it.

Sample "simple" code.

@(Html.Kendo().PanelBar()
    .Name("TestPanelBar")
    .Items(items =>
    {
        items.Add()
            .Text("Spreadsheet1")
            .Content(@<text>
                    @(Html.Kendo().Spreadsheet()
                                        .Name("TestSpreadsheet")
                                        .HtmlAttributes(new { style = "width:100%" })
                                        .Sheets(sheets =>
                                        {
                                            sheets.Add()
                                                .Name("Sheet1")
                                                .Columns(columns =>
                                                {
                                                    columns.Add().Width(200);
                                                    columns.Add().Width(200);
                                                })
                                                .Rows(rows =>
                                                {
                                                    rows.Add().Height(25).Cells(cells =>
                                                    {
                                                        cells.Add()
                                                            .Value("Column1")
                                                            .Background("rgb(167,214,255)")
                                                            .Color("rgb(0,62,117)")
                                                            .TextAlign(SpreadsheetTextAlign.Center);

                                                        cells.Add()
                                                            .Value("Column2")
                                                            .Background("rgb(167,214,255)")
                                                            .Color("rgb(0,62,117)")
                                                            .TextAlign(SpreadsheetTextAlign.Center);
                                                    });
                                                });
                                        })
                    )
                </text>);
            })
)

Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
1 answer
171 views

Hello Everyone,
You can use the Spreadsheet Demo on the Telerik Web site.
Select one of the numeric values in the quantity column and choose Data Validation -> List.
Write H1:H3 on the Value for validation and fill the range with values.

Now make sure you enter a number that fails validation. You receive correctly the error dialog.
Close it and Check the Data Validation Rule for that cell.
It has changed to: _matrix(H1:H3)
Now perform more failed validations (closing the dialogs).
Check again Data Validation Rule for that cell.
It has changed to more nested "_matrix" such as "_matrix(_matrix(H1:H3))"

This process of corruption continues with side effects such as: dialog opened as many times as the number of _matrix in the Data Validation Value.
Tested on IE Edge, IE 11 and Firefox 47.0.1 with same results.

Best Regards

Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
1 answer
217 views

Hi, I would like to validate ressource in a scheler

        @(Html.Kendo().Scheduler<SchedulerCustomViewDemo.Models.MeetingViewModel>()
    .Name("scheduler")
    .Date(new DateTime(2016, 6, 13))
    .StartTime(new DateTime(2016, 6, 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));
    })
    .Timezone("Etc/UTC")
    .Resources(resource =>
    {
        resource.Add(m => m.RoomID)
            .Title("Room")
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")

            .BindTo(new[] {
                    new { Text = "Meeting Room 101", Value = 1, Color = "#6eb3fa" },
                    new { Text = "Meeting Room 201", Value = 2, Color = "#f58a8a" }
           });
        resource.Add(m => m.Attendees)
            .Title("Attendees")
            .Multiple(false)
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .BindTo(new[] {
                    new { Text = "Alex", Value = 1, Color = "#f8a398" },
                    new { Text = "Bob", Value = 2, Color = "#51a0ed" },
                    new { Text = "Charlie", Value = 3, Color = "#56ca85" }
           });
    })
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.MeetingID);
            m.Field(f => f.Title).DefaultValue("No title");
            m.RecurrenceId(f => f.RecurrenceID);
        })
        .Events(e => e.Error("error_handler"))
        .Read("Meetings_Read", "Home")
        .Create("Meetings_Create", "Home")
        .Destroy("Meetings_Destroy", "Home")
        .Update("Meetings_Update", "Home")
    )
        )

So I would like to valide the Attendee  Field so as to make it required but it is not possible to apply .HtmlAttribute to .Ressource :

(HtmlAttributes(new { required = "required", data_required_msg = "Select start time", style = "width: 220px" }))

       resource.Add(m => m.Attendees)
            .Title("Attendee")
            .Multiple(false)
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .BindTo(new[] {
                    new { Text = "Alex", Value = 1, Color = "#f8a398" },
                    new { Text = "Bob", Value = 2, Color = "#51a0ed" },
                    new { Text = "Charlie", Value = 3, Color = "#56ca85" }
           });

Regards
Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
9 answers
266 views

Hello, 

I use a grip component from UI for ASP.NET MVC and I have a problem with localization of the grid. 

The problem is on image "grid1.png". In a red rectangle there is the wrong localized text and in a green rectangle there is the right/correct localized text.

I'm loading these javascripts on the web page (where variable culture is "cs-CZ"):

<script src="@Url.Content("~/Scripts/kendo/cultures/kendo.culture." + culture + ".min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/messages/kendo.messages." + culture + ".min.js")"></script>
 
<script>
        $(document).ready(function () {
            kendo.culture("@culture"); //culture of your choice
            $.validator.addMethod('date',
               function (value, element) {
                   return this.optional(element) || kendo.parseDate(value)
               });
        });
</script>

All javascripts, which are loaded on the web page, are on image "scripts.png". 

Could you help me? 

Thank you for your advice.

 

Maria Ilieva
Telerik team
 answered on 10 Aug 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?