Telerik Forums
Kendo UI for jQuery Forum
1 answer
197 views
I tried updating my version of Kendo from 2017.3.913 (R3 2017) to 2018.1.221 (R1 2018 SP1), but I ran into an issue with the latest Typescript declarations. In previous versions of Kendo, the Typescript declarations added extension methods for all kendo components onto the jQuery interface. The latest release (2018.1.221) seems to only add a couple of extensions, but the bulk of the components no longer have extension methods. Is this a bug, or a whole-sale change to the declarations?
Milena
Telerik team
 answered on 23 Feb 2018
12 answers
1.1K+ views

Hello,

I use the following Code to create a Kendo window dynamical to load a partial view - after closing the window I call the destroy method
to remove the window and it Content from the DOM.

$("<div id='win" + name + "' />").kendoWindow({
                    title: stitle,
                    actions: ["Close"],
                    draggable: false,
                    resizable: false,
                    //appendTo: "#containerTest",
                    modal: true,
                    animation: {
                        open: {
                            effects: "slideIn:left",
                            duration: 500
                        },
                        close: {
                            effects: "slideIn:left",
                            reverse: true,
                            duration: 500
                        }
                    },
                    visible: false,
                    pinned: false,
                    content: { url: surl, iframe: iframe },
                    close: function (e) {
                    },
                    deactivate: function (e) {
                        this.destroy();
                    }
                });
 
                var window = $(windowname).data("kendoWindow");
                window.wrapper.addClass("gpdb-sidebar-window");
                window.open();

 

But there is a Performance Problem if I open the window in a view with a Kendo grid with more then 500 rows - it seems that to use the destroy() in the deactivate Event of the window becomes slower and slower the more rows in the grid exists...

I have attached a Picture from the Chrome performance analyser - it seems there is a "Recalculate Style" in Kendo.all.js which is called often...

robert

 

Ivan Danchev
Telerik team
 answered on 23 Feb 2018
8 answers
421 views

How do I debug a source binding that isn't working?

I know i have an ObservableArray that I know exists and has data because if I for loop over it then data shows up

 

//works
<script id="tripEventTemplate" type="text/x-kendo-template">

 # for(var i=0; i < Waypoints.length; i++){ #
            <div style="color:#:Waypoints[i].FontColor #;margin-bottom:10px;background-color:#:Waypoints[i].BackgroundColor #">
                <div>
                    <div>#= Waypoints[i].description #</div>
                </div>
            </div>
            # } #

 

//But if I try to use a template for the array then it doesn't work

<script id="tripEventTemplate" type="text/x-kendo-template">
            <div data-template="tripWaypointCalendarTemplate"
                 data-bind="source: Waypoints">
            </div>

 

 

<script id="tripWaypointCalendarTemplate" type="text/x-kendo-template">
        <div style="color:#:FontColor #;margin-bottom:10px;background-color:#:BackgroundColor #">
            <div>
                <div>#:description #</div>
            </div>
        </div>
    </script>

Tyler
Top achievements
Rank 1
 answered on 23 Feb 2018
1 answer
162 views

Hi.

I have a problem: tooltip's background color in charts was missing. I tried to fix this but one color for all tooltip bg does not suit. It is necessary that backgorund color coincides with the color of the graphic

Can you tell me please how to fix this?

Stefan
Telerik team
 answered on 23 Feb 2018
3 answers
1.1K+ views

Hello All,

 

I have a Kendo Grid that has a Kendo upload inside of a column. I am currently getting the byte array of an image uploaded thru the Kendo Upload control but having difficulty passing that back to the Kendo Gird so it can add it to its model and  call then .Update method from its controller once the update button from the Kendo Grid is pressed.

 

My Editor template is returning a byte array I am having trouble getting the Kendo grid to recieve this data and add it to its model before it calls the .Update Method from my controller... Currently the grid calls .Update but the field where the byte[] should be set to is null. 

 

Please let me know if I should attach more code and how I can resolve this issue, Thanks In advance!

 

 

Grid 

@(Html.Kendo().Grid<AuctionItemModel>()
          .Name("UserGrid")
           
          .Columns(columns =>
          {
              columns.Bound(p => p.ItemName).Filterable(true).Width(50);
              columns.Bound(p => p.ItemDescription).Filterable(true).Width(250);
              columns.Bound(p => p.BidIncrement).Filterable(true).Width(25);
              columns.Bound(p => p.ItemPrice).Filterable(true).Width(25);
              columns.Bound(p => p.ImageBytes).ClientTemplate("<img height = '100' width = '100' src='" + "data:image/gif;base64,#=Image64#'").Title("Photo").EditorTemplateName("ResumeFileUrl");
              columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250); // command.Destroy();
          })
          .ToolBar(toolbar => toolbar.Create().Text("Add AuctionItem"))
          .Editable(editable => editable.Mode(GridEditMode.InLine))
          .Filterable(filter => filter.Enabled(true))
          .Pageable()
          .Sortable()
                   
          .Resizable(x => x.Columns(false))
          .Events(x => x.Edit("doOnRowSelect"))
 
          .DataSource(dataSource => dataSource
           
              .Ajax()
              .PageSize(20)
              
              .Model(model => {  model.Id(p => p.AuctionItemID);  })
              .Create(update => update.Action("Create", "AuctionItem"))
              .Read(read => read.Action("Read", "AuctionItem"))
              .Update(update => update.Action("Update", "AuctionItem").Data("ItemFormValues"))
           .Destroy(update => update.Action("Destroy", "AuctionItem"))
          ))

 

EditorTemplate:

@model byte[]
@(Html.Kendo().Upload()
.Name("ResumeFileUrl")
 
.Events(events =>
{
     events.Select("onSelectResumeFile");
     events.Success("onUploadSuccessResumeFile");
})
.Messages(messages =>
{
    messages.Select("Upload");
})
.Async(async =>
{
    async.Save("SaveResumeFile", "AuctionItem");
    async.Remove("DeleteResumeFile", "AuctionItem");
    async.AutoUpload(true);
})
.Multiple(false))

 

SaveImageFunction:

public JsonResult SaveResumeFile()
       {
           string filename = String.Empty;
           const string sessionKey = "RESUMEFILE";
           byte[] fileBytes = null;
           if (HttpContext.Request.Files != null && HttpContext.Request.Files.Count > 0 && HttpContext.Session != null)
           {
               List<HttpPostedFileBase> files = HttpContext.Session[sessionKey] as List<HttpPostedFileBase>;
               foreach (string fileName in HttpContext.Request.Files)
               {
                   HttpPostedFileBase newFile = HttpContext.Request.Files[fileName];
                   if (files == null)
                   {
                       files = new List<HttpPostedFileBase> { newFile };
                   }
                   else
                   {
                       files.Add(newFile);
                   }
                   HttpContext.Session[sessionKey] = files;
                   if (newFile != null)
                       filename = Path.GetFileName(newFile.FileName);
 
                   Stream fileStream = newFile.InputStream;
                   var mStraemer = new MemoryStream();
                   mStraemer.SetLength(fileStream.Length);
                   fileStream.Read(mStraemer.GetBuffer(), 0, (int)fileStream.Length);
                   mStraemer.Seek(0, SeekOrigin.Begin);
                   fileBytes = mStraemer.GetBuffer();
            
               }
           }
           return Json(new { Type = "Upload", FileName = filename, /*Image64 = Convert.ToBase64String(fileBytes)*/ ImageBytes = fileBytes }, JsonRequestBehavior.AllowGet);
       }

 

Stefan
Telerik team
 answered on 23 Feb 2018
4 answers
1.2K+ views

Hi there,

I'm having trouble with a Kendo grid resizing.  Basically, the content is extending beyond the width of my table, when the content should be wrapping instead.  I've added a screenshot to try and display the issue - the 'Description' column should be wrapping but instead isn't and the table content therefore is going beyond the width of the div the table sits in.  Furthermore, using the debug tools in Chrome shows that the table itself is positioned correctly, but it's the th and td cells which are displaying outside of the table area (hopefully the screenshot demonstrates that too).  The code I am using in my view is fairly basic :-

Html.Kendo().Grid((IEnumerable<TEAMSPortalV2.Models.SampleComputedDataViewModel>)ViewData["samples"]) // Bind the grid to the Model property of the view
            .Name("ItemsByRiskSamples")
            .Sortable()
            .Columns(columns =>
            {
                columns.Bound(s => s.BuildingDesignation).Title("Building");
                columns.Bound(s => s.FloorNoConverted).Title("Floor");
                columns.Bound(s => s.RoomDescription).Title("Room");
                columns.Bound(s => s.RegisterItemNo).Title("Item No.");
                columns.Bound(s => s.SampleRef).Title("Sample Ref.").Width(40);
                columns.Bound(s => s.SourceDescription).Title("Description");
                columns.Bound(s => s.AsbestosType);
                columns.Bound(s => s.MaterialAssessmentScoreString).Title("MA Score").Width(40);
                columns.Bound(s => s.PriorityAssessmentScore).Title("PA Score").Width(40);
                columns.Bound(s => s.RiskScore).ClientTemplate("<span bgcol='#= RiskScoreGroupColour#'>#= RiskScoreString#</span>").Width(40);
                columns.Bound(s => s.RecommendedAction).Title("Rec. Action").ClientTemplate("<span bgcol='#= RecommendedActionColour#'>#= RecommendedAction#</span>");
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .ServerOperation(false)
            )
            .Events(e => e.DataBound("itemBackColours"))

I've played around with it and by adding a width property to other columns sometimes rectifies the problem (but not always at smaller resolutions) seemingly randomly.  That said, I don't want to specify column widths - I'd rather let the browser display the content as efficiently as possible as per normal HTML table behaviour.  I also noticed that at wider resolutions it often seems to snap into the correct widths - which seems to suggest thast Bootstrap is involved somehow (my site has got Bootstrap installed).

Please could you assist and give me some suggestions of what I can try to rectify this issue.

Thanks, Mark

Stefan
Telerik team
 answered on 23 Feb 2018
3 answers
1.2K+ views

Hello,

I'm looking for a way to change the text of a toolbar button. I was hoping the following would work:

$("$myButton").text("My text");

 

Unfortunately, that also replaces the ImageUrl. Can you please tell me a supported way of changing the text?

Tim
Top achievements
Rank 1
 answered on 22 Feb 2018
1 answer
5.1K+ views
In the datasource of my kendo grid, there is a column which contains numbers as values. Consider them as a code. So is there a way to replace those numbers with a string which is provided with a property file or a json when creating the grid?

I can use a function to replace value before creating the grid, but then again it is a costly operation to replace in that manner if there are many records. If there is some other way to set the string as a title when hover over cell, that would be helpful too. 
Mark
Top achievements
Rank 1
 answered on 22 Feb 2018
4 answers
284 views
I already have a custom extended agenda view, is there by any chance a way to have my events sort DESC?  Users want the latest events at the top.
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 22 Feb 2018
7 answers
1.1K+ views
I have the following code in a partial view (MVC4)

<fieldset>
    <legend>Additional Loose Parts</legend>
    <table>
        <tr>
            <td>Part Number</td>
            <td>Quantity</td>
            <td></td>
        </tr>
        <tr>
            <td>@( Html.Kendo().DropDownList()
                       .Name("AvailableLooseParts1")
                       .Events(ev => ev.Change("AutomationDeviceMappingDDLChanged"))
                       .DataTextField("Name")
                       .DataValueField("PartNumberId")
                       .DataSource(source => source.Read(read => read.Action("LooseParts", "AutomationDevice")))
                       .HtmlAttributes(new { style = string.Format("width:{0}px", 200) })
                      )
            </td>
            <td>
                <input type="text" id="textboxLoosePartQuantity" class="bpNumeric" style="width: 30px" /></td>
            <td>
                <button type="button" id="buttonAddLoosePart" onclick="onAddLoosePart()" title="Add Loose Part" value="Add"></button>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                @(Html.Kendo().Grid<BluePillar.Aurora.DataEntity.Models.AutomationDevicePartsMapping>()
                      .Name("GridAutomationDevicePartsMapping")
 
 
                      .ToolBar(toolbar => toolbar.Template(
             @<text>
                Site:
               @( Html.Kendo().DropDownList()
                       .Name("AvailableLooseParts2")
                       .Events(ev => ev.Change("AutomationDeviceMappingDDLChanged"))
                       .DataTextField("Name")
                       .DataValueField("PartNumberId")
                       .OptionLabel("Any")
                       .DataSource(source => source.Read(read => read.Action("LooseParts", "AutomationDevice")))
                      )
                </text>
                                 ))
 
 
                      .Editable(editable => editable.Mode(GridEditMode.InCell))
                      .Pageable()
                      .Sortable()
                      .Scrollable()
                      .Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single))
                      .DataSource(dataSource => dataSource
                                                    .Ajax()
                                                    .Batch(true)
                                                    .ServerOperation(false)
                                                    .Model(model =>
                                                               {
                                                                   model.Id(p => p.AutomationDeviceId);
                                                                   // model.Field(p => p.PartNumberName).Editable(false);
                                                               })
                                                    .Create(update => update.Action("CreateNewAutomationDevicePartsMap", "AutomationDevice"))
                                                    .Read(read => read.Action("GetAutomationDeviceMaps", "AutomationDevice").Data("AutomationDeviceID"))
                                                    .Update(update => update.Action("UpdateAutomationDevicePartsMap", "AutomationDevice"))
                                                    .PageSize(50)
                      )
                      .Events(e => e.DataBound("GridAutomationDevicePartsMapping"))
                       .Columns(columns =>
                                   {
                                       columns.Bound(s => s.PartNumberName)
                                           .Width(300);
                                       //.ClientTemplate(Html.Kendo().DropDownList()
                                       //                    .Name("PartNumberxyz")
                                       //                    .Events(ev => ev.Change("AutomationDeviceMappingDDLChanged"))
                                       //                    .DataTextField("Name")
                                       //                    .DataValueField("PartNumberId")
                                       //                    .DataSource(source => source.Read(read => read.Action("LooseParts", "AutomationDevice")))
                                       //                    .ToClientTemplate()
                                       //                    .ToHtmlString());
                                       columns.Bound(p => p.QuantityMultiplier).Title("Quantity");
                                       columns.Command(commands => commands.Destroy()).Width(100);
                                   })
                      )
            </td>
        </tr>
    </table>
 
</fieldset>

when I run this code the dropdownlist outside of the grid (AvailableLooseParts1) shows but the one in the Toolbar section of the grid (AvailableLooseParts2) does not appear at all.   They are identical except for the names.   Can someone please give me a clue what I could possibly be doing wrong.

Stefan
Telerik team
 answered on 22 Feb 2018
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?