Telerik Forums
Kendo UI for jQuery Forum
1 answer
226 views

I am trying to set up a cascading drop down list using the resources of a scheduler.

The drop down lists work fine, but when i try to declare the parent/child cascade using the 'cascadeFrom' the cascade does not work at all.

 

Here is my code:

<div id="resourcesContainer">
</div>

<script>
    jQuery(function () {
        var container = jQuery("#resourcesContainer");
        var resources = jQuery("#scheduler").data("kendoScheduler").resources;
        for (var resource = 0; resource < resources.length; resource++)
        {
            jQuery(kendo.format('<div class="k-edit-label"><label for="{0}">{1}</label></div>', resources[resource].name, resources[resource].title)).appendTo(container);
            var divID = resources[resource].name + "kdd";
            var labcont = jQuery(kendo.format('<div id="{0}" class="k-edit-field"></div>', divID)).appendTo(container);

            if (resources[resource].name !== "LocationRoom") {
                jQuery(kendo.format('<select data-bind="value: {0}">', resources[resource].field))
                        .appendTo(labcont)
                        .width(300)
                        .kendoDropDownList({
                            filter: "contains",
                            dataTextField: resources[resource].dataTextField,
                            dataValueField: resources[resource].dataValueField,
                            dataSource: resources[resource].dataSource,
                            valuePrimitive: resources[resource].valuePrimitive,
                            optionLabel: "Select...",
                            template: kendo.format('<span class="k-scheduler-mark" style="background-color:\#= data.{0}?{0}:"none" \#"></span>\#={1}\#', resources[resource].dataColorField, resources[resource].dataTextField)
                        });
            }
            else if(resources[resource].name === "LocationRoom")
            {
                jQuery(kendo.format('<select data-bind="value: {0}">', resources[resource].field))
                       .appendTo(labcont)
                       .width(300)
                       .kendoDropDownList({
                           autoBind: false,
                           cascadeFrom: "Locationkdd",
                           optionLabel: "Select location first...",
                           dataTextField: resources[resource].dataTextField,
                           dataValueField: resources[resource].dataValueField,
                           dataSource: resources[resource].dataSource,
                           valuePrimitive: resources[resource].valuePrimitive,
                           template: kendo.format('<span class="k-scheduler-mark" style="background-color:\#= data.{0}?{0}:"none" \#"></span>\#={1}\#', resources[resource].dataColorField, resources[resource].dataTextField)
                       });
            }
        }
    });
</script>

 

HOWEVER, if i change jQuery(kendo.format('<select data-bind="value: {0}">', resources[resource].field)).appendTo(labcont).Width(300)..... to jQuery("#" + divID).Width(300).... it works, but obviously the MVVM binding is completely lost.

Any ideas?

 

Chris
Top achievements
Rank 1
 answered on 03 Jun 2016
5 answers
1.0K+ views
Hi,

I am currently trialing Kendo UI Professional for an AngularJS application. I order to debug some issues I would like to work with the unminified JS files. Are these available for download or only after purchasing?

Thanks,
Claus
Stephen
Top achievements
Rank 2
 answered on 03 Jun 2016
2 answers
491 views

<div class="chart-cell">
    <div id="chart" />
</div>

$.get("/chart/GetCustomPlotData", data, function (response) {
    if (response.Success) {
        var result = response.Result;
 
        if (result.IsAggregated) {
            $("#data-point-count").text(result.DataSet.ChannelData[0].Data.length + " of " + result.DataSet.DataPointsInFile);
        }
        else {
            $("#data-point-count").text(result.DataSet.ChannelData[0].Data.length);
        }
 
        // Format the data then generate the graphs
        var seriesData = [];
        for (var i = 0; i < result.DataSet.ChannelData.length; ++i) {
            var data = []
            for (var j = 0; j < result.DataSet.ChannelData[i].Data.length; ++j) {
                data[j] = { Time: new Date(FormatUtsDate(result.DataSet.ChannelData[i].Data[j].Time)), Value: result.DataSet.ChannelData[i].Data[j].Value }
            }
 
            seriesData[i] = {
                name: result.DataSet.ChannelData[i].Title !== "" ? result.DataSet.ChannelData[i].Title : result.DataSet.ChannelData[i].ChannelName,
                visibleInLegend: false,
                tooltip: {
                    template: "value: #= value.y #, time: #= FormatDate(value.x) #",
                    visible: true
                },
                type: "scatterLine",
                xField: "Time",
                yField: "Value",
                data: data,
                markers: {
                    visible: false
                }
            }
        }
 
        $("#chart").kendoChart({
            series: seriesData,
            chartArea: {
                @* There is probably a better way to do this, but I can't think of it right now.
                This occurs before the divs are rendered so their widths at this point are not
                what they will be after rendering *@
                //width: 1074
            },
            xAxis: [{
                type: "date",
                baseUnit: "seconds",
                labels: {
                    step: (result.Columns == 3 ? 2 : 1)
                }
            }],
            yAxis: [{
                axisCrossingValue: [-50000]
            }],
            legend:{
                position: "left",
                orientation: "horizontal",
                visible: true
            },
            pannable: true,
            zoomable: true,
        });
 
        kendo.ui.progress($(".chart-loading"), false);
        $("#loading").hide();
        $("#nine-blocker-grid").show();
    }
    else {
        kendo.ui.progress($(".chart-loading"), false);
        $("#loading").hide();
        $("#error-message").text(response.Message);
        $("#error").show();
    }
});

All the series are being plotted, but for whatever reason the legend does not display. Just wonder if there is any obvious reason why that might be

Thanks

Chris
Top achievements
Rank 1
 answered on 03 Jun 2016
1 answer
189 views

Hi, 

I need to create an online tool for designing database ER diagrams using Kendo UI. I know that TelerikUI for WPF has a Diagram component with an example for creating Tableshapes (or ER Diagram).  Is there any such example for KendoUI?

Thanks

Daniel
Telerik team
 answered on 03 Jun 2016
3 answers
726 views
Hi I want to create a grid using the server wrapper without having to specify a certain model, I just want a column to put string values and a custom column to delete the values.

so with javascript I can do that this way:

​ $("#gridtest").kendoGrid({
height: 150,
columns: [
{
attributes: {"style":"padding-left:0px"},
field: "date",
title: "Selected Dates",
},
//{ command: [{ className:"select", name: "destroy", text: "" }], title: " ", width: 40 }
{ command: [{ id: "destroy", name: "destroy", template: "<img class='select' src='@Url.Content("~/Contents/Images/delete.png")' onclick='deleteGridRow(this)'/>" }], title: " ", width: 40 }
],
editable: "inline"
});


Dimiter Madjarov
Telerik team
 answered on 03 Jun 2016
1 answer
260 views

Greetings, Is there a way to easily move the "show all day" / "show business hours" out of the footer and into the header next to the view selector list? I tried moving it with jQuery, but it loses its functionality at that point:

$(".k-scheduler-fullday").parent().insertAfter(".k-scheduler-views")

It would be great to be able to move the button without having to recreate the functionality myself. Thanks in advance for any help!

Rafe

Vladimir Iliev
Telerik team
 answered on 03 Jun 2016
1 answer
288 views

I've a grid with scrollable: {virtual: true}. I insert a new row on top of the grid, using either .addRow() or grid.dataSource.insert(0, {});

Then I try to scroll the grid, I saw some error in the console saying:

 

<p color="red">Uncaught RangeError: Maximum call stack size exceeded</p>

 

Here is a dojo example: http://dojo.telerik.com/UCiXA/2

 

I think this error will cause some other issues. In this dojo, we can see that the values on the footer(i.e. 21 - 40 of 77 items) is not updating correctly. In my product, it will cause some paging issue, I will see the page size jumping for 10 to 5 while scrolling, and sometime performance issue that will cause slow repose.

Dimiter Madjarov
Telerik team
 answered on 03 Jun 2016
1 answer
338 views

Hi Telerik Team,

I have a grid using Ajax for data like so

.DataSource(dataSource =>
    dataSource.Ajax()
        .PageSize(20)
        .ServerOperation(true)
        .Read(read => read.Action("GetSerializedItems", "Inventory", new { storeId = Model.StoreID, fromSerialNo = Model.FromSerialNo , stockCode=Model.StockCode }))

And my Action in Controller 

[HttpPost]
public JsonResult GetSerializedItems([DataSourceRequest]DataSourceRequest request, List<string> fromSerialNo, string stockCode, string storeId)

And the Model for the request

public class RequestQueryInventoryStatus
{
    public string StoreID { get; set; }
    public List<string> FromSerialNo { get; set; }
    public string StockCode { get; set; }
    public string UserId { get; set; }
 
    public int? take { get; set; }
    public int? skip { get; set; }
    public int? page { get; set; }
    public int? pageSize { get; set; }
    public string sortField { get; set; }
    public string sortDir { get; set; }
}

However, the Action is unable to recognize the List of string and it takes the type System.Collections.Generic.List`1[System.String] as value instead. If I stringify the object Model.FromSerialNo, it will be too long to be in the query string, however the payload data of the post request has already been occupied by DataSourceRequest (with info like sort, page, etc.). Is there anyway to work around this issue?

Thanks,

Hery.

Ianko
Telerik team
 answered on 03 Jun 2016
1 answer
183 views

Hello,

The "Edit this example" dojo sample from the ButtonGroup doesn't work because the wrong style sheet is linked. It's currently kendo.bootstrap.min.css but should be kendo.bootstrap.mobile.min.css

Cheers

Jae Soon

Petyo
Telerik team
 answered on 03 Jun 2016
1 answer
248 views

Is it possible to add comments to cells so that when you highlight the cell it displays the comment? This feature exists in excel as follows:

https://support.office.com/en-us/article/Add-a-comment-bdcc9f5d-38e2-45b4-9a92-0b2b5c7bf6f8

Thank you.

Stefan
Telerik team
 answered on 03 Jun 2016
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
Drag and Drop
Application
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?