Telerik Forums
Kendo UI for jQuery Forum
3 answers
691 views
Hi Team,
     I'm trying to override the some of the keyboard shortcuts for kendo grid.
What I need is to make the pageup/pagedown for top/bottom of screen and use home/end keys for start/end of dataset. Can you please suggest on how can I achieve this?
Sibin
Top achievements
Rank 1
 answered on 31 Dec 2020
10 answers
957 views

I have a grid that uses inline editing. There are also many pages of data, and I noticed that if I sort by any column, then click the "Add new record" button, I don't see the new row appear (I assume it is created at the end of the last page). However when I go to the last page, the row is already created, except it is all blank! I have some required fields that the user needs to fill in before creating the row, but in this situation, the row is created by itself without any values. This blank row only appears on the frontend (doesn't do anything serverside), and clicking "Update" then "Cancel" removes the row from the table...

Preferably, I would like to be able to jump to the page that contains the created row so that the user doesn't have to go looking for a blank row if they try inserting while the grid is sorted.

Thanks

 

Aleksandar
Telerik team
 answered on 31 Dec 2020
3 answers
409 views

I have a spreadsheet with some formula (es. =A1*B2/5).

So I get the Json data and I see that something like that

{
      "name": "Sheet1",
      "rows": [
        {
          "index": 31,
          "cells": [
            {
              "value": 5,
              "format": "#",
              "index": 1
            },
            {
              "value": 10,
              "formula": "B32*2",
              "index": 2
            }
          ]
        }

is it possibile to use the js to get the calulated data or exist a .net dll to convert js"excel" style formula to data?

Veselin Tsvetanov
Telerik team
 answered on 30 Dec 2020
2 answers
1.3K+ views

I am trying to use async chunk upload with Web API 2.
But always after first chunk I am receiving message “Cannot read property 'chunkIndex' of undefined”.
What did I do wrong?

 

using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Web;
using System.Web.Hosting;
using System.Web.Http;
 
namespace UploadWebApi.Controllers
{
    public class UploadController : ApiController
    {
        [DataContract]
        public class ChunkMetaData
        {
            [DataMember(Name = "uploadUid")]
            public string UploadUid { get; set; }
            [DataMember(Name = "fileName")]
            public string FileName { get; set; }
            [DataMember(Name = "contentType")]
            public string ContentType { get; set; }
            [DataMember(Name = "chunkIndex")]
            public long ChunkIndex { get; set; }
            [DataMember(Name = "totalChunks")]
            public long TotalChunks { get; set; }
            [DataMember(Name = "totalFileSize")]
            public long TotalFileSize { get; set; }
        }
 
        public class FileResult
        {
            public bool Uploaded { get; set; }
            public string FileUid { get; set; }
        }
 
        public class Files
        {
            public string Extension { get; set; }
            public string Name { get; set; }
            public int Size { get; set; }
            public string Uid { get; set; }
        }
 
        public IHttpActionResult Save(HttpFileCollection files)
        {
            string path = String.Empty;
            if (files != null)
            {
                for (var i = 0; i < files.Count; i++)
                {
                    path = Path.Combine(HostingEnvironment.MapPath("~/App_Data"), files[i].FileName);
                    files[i].SaveAs(path);
                }
            }
            return Ok("");
        }
 
        public IHttpActionResult Remove(string[] fileNames)
        {
            if (fileNames != null)
            {
                foreach (var fullName in fileNames)
                {
                    var fileName = Path.GetFileName(fullName);
                    var physicalPath = Path.Combine(HostingEnvironment.MapPath("~/App_Data"), fileName);
                    if (File.Exists(physicalPath))
                    {
                        File.Delete(physicalPath);
                    }
                }
            }
            return Ok("");
        }
 
        public void AppendToFile(string fullPath, Stream content)
        {
            try
            {
                using (FileStream stream = new FileStream(fullPath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
                {
                    using (content)
                    {
                        content.CopyTo(stream);
                    }
                }
            }
            catch (IOException ex)
            {
                throw ex;
            }
        }
 
        public IHttpActionResult ChunkSave()
        {
            var files = HttpContext.Current.Request.Files;
            var metaData = HttpContext.Current.Request.Form["metadata"];
            if (metaData == null)
            {
                return Save(files);
            }
            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(metaData));
            var serializer = new DataContractJsonSerializer(typeof(ChunkMetaData));
            ChunkMetaData somemetaData = serializer.ReadObject(ms) as ChunkMetaData;
            string path = String.Empty;
            if (files != null)
            {
                for (var i = 0; i < files.Count; i++)
                {
                    path = Path.Combine(HostingEnvironment.MapPath("~/App_Data"), somemetaData.FileName);
                    AppendToFile(path, files[i].InputStream);
                }
            }
            FileResult fileBlob = new FileResult();
            fileBlob.Uploaded = somemetaData.TotalChunks - 1 <= somemetaData.ChunkIndex;
            fileBlob.FileUid = somemetaData.UploadUid;
            return Json(fileBlob);
        }
    }
}
Alexander
Top achievements
Rank 2
 answered on 30 Dec 2020
1 answer
281 views

We've used the NPM/Bower/gulp method of making custom Kendo JS packages for our webapp and ran into a problem (using 2020.3.1118). Your build system doesn't seem to like Node.js v12? You are specifying gulp 3.9.1 in  src/package.json, which is no longer supported, and which breaks under Node.js v12.  I had to install Node v10 again to get it to work.  If you are broken under node 12+, it would be nice to have that mentioned in your documentation, for instance here: https://docs.telerik.com/kendo-ui/intro/installation/what-you-need

Will you be updating the custom build system so that it works under recent Node.js versions? 

Misho
Telerik team
 answered on 30 Dec 2020
9 answers
1.8K+ views
Hi,

Is it possible to close the window when the user clicks somewhere outside the window (which is not modal)?

Thanks,
David A.
Martin
Telerik team
 answered on 30 Dec 2020
10 answers
1.1K+ views
Hello

I'm using inline editing in a grid, which is all working fine. However, when I add sorting, and a column is using a descending sort, the new record row (the editable one, not a newly inserted row) is actually added at the bottom. Not really a problem if there's only one page, but it's not so cool when it's at the bottom of page 19. Yes, I can go to that last page, or reverse the sorting, and I'll see the boxes, but it would still be cool if the new record row was always at the top.

Example here: http://jsfiddle.net/EEJsG/1/ It's using the "Inline editing" demo code from this website, with only "sortable: true" added.

To see my problem, just click "Unit Price" twice and click the add new record button.

Is this a bug, or am I missing a setting?

Thanks!
Alessandro Stefano
Top achievements
Rank 1
 answered on 29 Dec 2020
6 answers
583 views
Hi, I have a grid with the editable mode set to popup like so:
.Editable(editable => { editable.Mode(GridEditMode.PopUp); editable.TemplateName("EmailTemplate"); })
And then "EmailTemplate" looks like so:

@model Young_Ealing.Models.EmailTemplate
 
@Html.LabelFor(m=>m.Name)
@Html.TextBoxFor(m=>m.Name)
@Html.LabelFor(m=>m.Subject)
@Html.TextBoxFor(m=>m.Subject)
@Html.LabelFor(m=>m.Body)
@(Html.Kendo().EditorFor(m=>m.Body).Name("Body").Tools(tools => tools.FontName().Bold().Clear().CreateLink().FontSize().FormatBlock().Indent()
            
.InsertImage().InsertOrderedList().InsertUnorderedList().Italic().JustifyCenter()            .JustifyFull().JustifyLeft().JustifyRight().Outdent().Separator().Strikethrough()
            .SubScript().SuperScript().Underline().Unlink().ViewHtml().CustomButton(cb => cb.Name("add_name").ToolTip("insert individual name").Exec(@<text>
            function(e) {
                var editor = $(this).data("kendoEditor");
                editor.exec("inserthtml", { value: "@(Young_Ealing.Code.EmailUtils.TEMPLATE_INDIVIDUAL_NAME)" });
            }
        </text>))).HtmlAttributes(new { style = "width: 785px;height:295px;"}))
@Html.LabelFor(m => m.IsHtml)
@Html.CheckBoxFor(m => m.IsHtml)
<div class="clear"></div>
Everything works as expected except the Editor does not show the contents of the "Body" field and when I post the form back the contents of EmailTemplate.Body is null. All the other fields save and display fine. And if I bind "Body" to a normal text area it works fine too, so the problem lies somewhere in my implementation of the Kendo UI Editor.
Sajitha
Top achievements
Rank 1
Veteran
 answered on 28 Dec 2020
3 answers
1.9K+ views

I'm trying to add a Kendo Tooltip to a disable DropDownList, but it's not working. :/

My DropDowList:

@(Html.Kendo().DropDownListFor(m => m.AgencyId)
                      .OptionLabel("-- Select --")
                      .DataTextField("ProviderName")
                      .Name("ddlb_FedCarewarePDI_Provider")
                      .DataValueField("ProviderId")
                      .DataSource(src =>
                      {
                          src.Read(r =>
                          {
                              r.Action("getAgencyList", "AgencyReports").Type(HttpVerbs.Post);
                          });
                      }).HtmlAttributes(new { style = "width: 300px" })
                    )

 

My Kendo Tooltip Code:

@(Html.Kendo().Tooltip()
    .For("#ddlb_FedCarewarePDI_Provider")
    .ContentTemplateId("template")
    .Position(TooltipPosition.Top)
    .Width(400)
    .Height(500)
)
 
<script id="template" type="text/x-kendo-template">
    <p>#=Something Great Here#</p>
</script>

 

Ideas on what I need to fix?

 

 

 

 

 

 

 

Plamen
Telerik team
 answered on 25 Dec 2020
3 answers
2.1K+ views
I am trying to set the tools using EditorFor to create a text editor that shows with no tools 
as the default view but cannot get the syntax correct.

@
Html.Kendo().EditorFor(m
 => m.ChildViewModel.Text).HtmlAttributes(new { Width = "100%", tools = "[]" })

I would also like to show a limited number of tools using the same method for another editor
on the same page.



Please show me the correct syntax for configuring tools using the 'Html.Kendo().EditorFor'
method.

Thanks
Misho
Telerik team
 answered on 24 Dec 2020
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?