Telerik Forums
Kendo UI for jQuery Forum
1 answer
198 views
owasp reports vulnerability to the jquery version you ship together with components, any plans to switch to the upper version?
Vessy
Telerik team
 answered on 28 Dec 2021
1 answer
942 views

I have a grid with foreign key columns

columns.ForeignKey(c => c.LanguageID, (System.Collections.IEnumerable)ViewData["languages"], "Id", "Description").Title("Language").Width(200);

I want to get the text value of the foreign key drop down value ie: English in this case for selected rows.

I can Iterate selected rows and get the dataItem
       grid.select().each(function () {

            var dataItem = grid.dataItem($(this));
            console.log(dataItem);
        
        });
which gets me the Id 

 

is there an easy way to read the description?

Thanks

 

Tsvetomir
Telerik team
 answered on 27 Dec 2021
1 answer
101 views

Dear sirs, I can't get a result.

As you can see, the first value for (01.01.2021) is located in the middle of first step.

Can you help me guess please, how should I configure the chart to bring the 01.01.2021 with it's value (0) right to the zero level of X line?

I'd like the chart values move left in a half of the cell step.

Vessy
Telerik team
 answered on 24 Dec 2021
0 answers
163 views

Greetings. I am getting the following error while uploading a file with Kendo upload. Code works fine at local. But it gives this error on the server.

Error:

 

Client-Side Code:

             

 $("#batchFile").kendoUpload({
                   async: {
                       saveUrl: '/DijitalArsiv/UploadFile/',
                       autoUpload: false
                   },
                upload: function (e) {


                    if (uploadFileNode.isMainFolder) {
                        realPath = realPath + "\\" + personelID
                    }

                    e.data = { "id": uploadFileNode.id, "path": realPath, "isMainFolder": uploadFileNode.isMainFolder, "type": uploadFileNode.spriteCssClass };


                   },
                   select: function (e) {

                       if (e.files.length != 0) {
                           $.each(e.files,function (index, value) {

                               var filtredValue =  acceptedFileTypes.filter(x => x == value.extension)
                               if (filtredValue.length == 0) {
                                   e.preventDefault();
                                   $("#message-alert").html("Sadece '.pdf', '.jpg', '.png', '.jpeg', '.docx', '.xlsx'  türünde dosyalar yükelenebilir. Lütfen yüklediğiniz dosyların türünü kontrol edin.")
                                    kendoWindowMessageAlertModal.data("kendoWindow").content($("#message-alert").html()).center().open();
                               }
                           })
                       }
                   },
                   success: function (e) {

                       if (e.response.Status) {
                           getTreeView().append([{ id: e.response.ID, text: e.response.FileName, spriteCssClass: e.response.Type, UnicParentCode: nodeToUploadParent.UnicParentCode, isDraggable: true, isDroppable: true, hasChildren: false, isEditable: false, isMainFolder: false }], nodeToUpload)
                           updateBackupTree();
                       } else {
                           e.preventDefault();
                       }
                   },
                   multiple: true,
                   batch: true,
                   localization: {
                        cancel: "İptal",
                        dropFilesHere: "Dosyalarınızı Buraya Sürükleyebilirsiniz!",
                        remove: "Sil",
                        retry: "Tekrar Dene!",
                        select: "Dosya Seç",
                        statusFailed: "Yükleme Başarısız!",
                        statusUploaded: "Yükleme Başarılı!",
                        statusUploading: "Yükleniyor...",
                        uploadSelectedFiles: "Yükle"
                   }
               });

Server-side Code:

        [HttpPost]
        public JsonResult UploadFile(HttpPostedFileBase batchFile, int? id, string path, bool isMainFolder,string type)
        {

        }

 

 

cirilla
Top achievements
Rank 1
 asked on 23 Dec 2021
1 answer
1.0K+ views

Hello, I'm currently working on a project for my company and ive encountered a problem. I dont know why I cant download the file attachment. ive attached a jpg file of the screenshot for you to see. There is a file attachment named sad kermit(2).jpg and a message in the console in the screenshot

This is my kendo form code in view.

$("#form").kendoForm({
            validatable: { validationSummary: true },
            orientation: "horizontal",
            formData: {
                ID: "@Model.ID",
                IssueNumber: "@Model.ISSUE_NUM",
                Title: "@Model.TITLE",
                Environment: "@Model.ENVIRONMENT",
                Application: "@Model.APPLICATION",
                Module: "@Model.MODULE",
                Priority: "@Model.PRIORITY",
                Status: "@Model.STATUS",
                FID: "@Model.FID",
                Jobname: "@Model.JOBNAME",
                Username: "@Model.USERNAME",
                MantisNumber: "@Model.MANTIS_NO",
                ModifiedBy: "@ViewBag.User_Name",
                Upload: "",
                ModifiedDate: "@Model.MODIFIED_DATE",
                Description: "@Model.DESCRIPTION",
                IssueType: "@Model.ISSUE_TYPE",
                IssueCategory: "@Model.ISSUE_CATEGORY",
                IssueResolution: "@Model.ISSUE_RESOLUTION",
                Remarks: "@Model.REMARKS",
                AssignedTo: "@Model.ASSIGNED_TO",
                CreatedBy: "@ViewBag.User_Name"
            },
            items: [{
                type: "group",
                label: "Edit Issue Details",
                items: [
                    ...,
                   ...,
                    ...,
                    ...,
                    ...,
                   ...,
                    ...,
                    ...,
                    ...,
                    ...,
                    ...,
                    {
                        field: "Upload",
                        label: "Upload File:",
                        editor: function (container, options) {
                            $("<input name='files' id='files' type='file' aria-label='files' />").appendTo(container).kendoUpload({
                                async: {
                                    saveUrl: '@Url.Action("UploadFiles", "Issue")',
                                    removeUrl: '@Url.Action("RemoveFiles", "Issue")',
                                    autoUpload: true
                                },
                                files: uploads
                            });
                        }
                    },
                    ...,
                    ...,
                    ...,
                    ...,
                    ...,
                    ...,
                    ...,
                    ...,
                ]
                }],
                submit: function (ev)...
            });

this is the code I use to try to download the file attachment in the same view but it isnt working I guess

$(".k-file").click(function (e) {
                var filename = $(this).find(".k-file-name").html();

                $.ajax({
                    type: "POST",
                    data: { "name": filename },
                    url: "/Issue/DownloadFile",
                    success: function (res) {
                        if (res.Success) {
                            console.log(res.DownloadUrl);
                            window.open(res.DownloadUrl, '_blank');
                        }
                    }
                });
            });
this is the controller 
[HttpPost]
        public ActionResult DownloadFile(string name)
        {
            var folderName = Session["IssueNum"] as string;

            string fileDirectory = Path.Combine(System.Web.HttpContext.Current.Request.PhysicalApplicationPath, "App_Data", folderName, name);

            return Json(new
            {
                Success = true,
                DownloadUrl = fileDirectory
            }, JsonRequestBehavior.AllowGet);
        }
Could you suggest me a solution? Thank you
Ianko
Telerik team
 answered on 22 Dec 2021
6 answers
1.5K+ views

One of my TreeList field is an array. For example:

var localData = [
{ id: 1, name: "​A Team", description: "", players:  ["a","b"], parentId: null },
{ id: 2, name: "Team Lead", description: "", players: ["c"], parentId: 1 }
];

The "players" field is an array. I configure the column like:

columns: [
{ field: "name", title: "Team", width: "350px" },
{ field: "description", title: "Description", width: "350px" },
{
title: "Players",
template: '{{ dataItem.players }}'
}]

However, the "Players" column shows like

["a","b"]

I expect it as

a, b

How do I fix it?

Thanks,

Muhammad
Top achievements
Rank 1
Iron
 answered on 22 Dec 2021
1 answer
134 views

Is there a way to filter the JSON data saved in the spreadsheet out of cells that are not filled with data but contain Spaces

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 20 Dec 2021
1 answer
189 views

Hello

I'm using an editable GRID with CREATE toolbar. I would like to customise my editable pop-up to add a kendoDropDownList for selecting a element in a list. 

In my exemple I have a grid with "accessoires"  I can ADD new one or DELETE existing ones

If I create I want to choose the new element in a kendoDropDownList  NOT in TYPE=INPUT 

 

 

 

How to do this ?

Here is the code of my GRID

  //Grille des accessoires
    $("#gvAccessoires").kendoGrid({
        columns: [
            {
            field: "LibelleObj",
            title: "Accessoire"
            },
            { command: [{ name: "destroy", text: "Supprimer", visible: function (dataItem) { return !dataItem.IsPublie } }], title: "&nbsp;", width: "250px" },
        ],

        editable: {
            mode: "popup",
            window: {
                title: "Saisie des accessoires",
                width: 600
            }
        },

        toolbar: ["create"],
        edit: function (e) {

???? how to add here the kendoDropDownList

        },
        save: function (e) {

            Accessoires.add(new Accessoire(false, e.model));

        },
        remove: function (e) {     
            _.forEach(selectedOP.Accessoires, function (item) {
                if (item.idObj == e.model.idObj) Accessoires.remove(item);
            });
        }

    });

 

        var ds3 = new kendo.data.DataSource({
            data: Accessoires,
            schema: {
                model: {
                    id: "idObj",
                    fields: {
                        id: { editable: false, nullable: true },
                        LibelleObj: { validation: { required: true } },
                    }
                }
            }
        });
        $("#gvAccessoires").data("kendoGrid").setDataSource(ds3);

 

Thank you

 

 

 

 

Georgi Denchev
Telerik team
 answered on 20 Dec 2021
0 answers
488 views

Hi,

I have tried this every way I can think of. I am having problems with setting data-bind while iterating an array.
Made a small demo below, the actual code is much more complex and that is the reason I need to use the for loop in order to get the correct result.

How can I set the data-bind property on the input correctly?

 

  <div id="container">
    <div id="weekdays" data-template="weekday" data-bind="source : this"></div>
  </div>
          
  <script id="weekday" type="text-x-kendo-template">
     <div>
    # for (i = 0; i < data.lines.length; i++) { #
    	<h2>#: data.lines[i].day #</h2>
    	<input type="text" data-bind="value: data.lines[i].quantity" />
    # } #
    </div>
  </script>
  <script>
  $(document).ready(function () {
      var vm = kendo.observable({
        lines: new kendo.data.ObservableArray([
           { id: 123, day: "Monday", quantity: 5 },
           { id: 322, day: "Tuesday", quantity: 2 }
        ])
  });
  kendo.bind($("#container"), vm);
 });
</script>


SpanTag
Top achievements
Rank 1
 updated question on 18 Dec 2021
1 answer
130 views

Hi,

Is there a way to auto align the cell width/height when double clicking on the cell header similar to what we have in excel?

1. Text is hidden due to cell width

2. Double click on the header line to auto align and show the full text.

 

Thanks in advance.

 

 

Martin
Telerik team
 answered on 17 Dec 2021
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?