Telerik Forums
Kendo UI for jQuery Forum
1 answer
131 views
We are using Kendo Dropdown in our project. One of example is:

  @(Html.Kendo().DropDownList()
            .Name("DELFLG")
            .Items(item =>
            {
                item.Add().Text("Ignore").Value("");
                item.Add().Text("Yes").Value("Y");
                item.Add().Text("No").Value("N").Selected(true);
            }).DataTextField("Text").DataValueField("Value").HtmlAttributes(new { style = "width:130px" })
            )    

Select last value in drop down and press key on keyboard which is NOT starting character of any list box item, it prompts script error. This is happening in kendo demo also.

http://demos.telerik.com/kendo-ui/web/dropdownlist/index.html



























Georgi Krustev
Telerik team
 answered on 29 Apr 2014
1 answer
303 views
Hi I am using kendo listview component as seen below:


$("#showHide").kendoListView({dataSource: vals,template: "<div style='overflow: hidden;text-overflow: ellipsis;white-space: nowrap;margin:4px;'>#:name#</div>",selectable: "multiple",
change:  function() {
selected = $.map(this.select(), function(item) {
return vals[$(item).index()].name;
              });     
},
});

Is there any way that i can find the max lenght element of whole content. for example 
1). asdf
2).asdfsadfasdf
3).asdfasdfsadfsadfasdf

In this 3 element is largest.

Please suggest if there is any way we can find the max length of all the elements.
Alexander Popov
Telerik team
 answered on 29 Apr 2014
1 answer
292 views
I'm in the process of creating a big business application using kendo ui. Since application is big. we have started to follow modular patter in javascript code.

When using modular pattern wtih kendo ui. i'm getting some errors.

i have created hierarchy grid. Each grid code will be modular object. like below:

But i'm getting below error: (I have bolded error lines. Please see below)

SCRIPT5007: Unable to get property 'find' of undefined or null reference.

Reason for error is "this" object is referred to window object. But it should refer kendo grid object.. how to resolve this

var Customer = (function ($,window) {
    var gridCustomer = null;
    var dataSource = null;
    var createColumns = function () {
        return [
                    {
                        field: "FirstName",
                        title: "First Name",
                        width: "110px"
                    },
                    {
                        field: "LastName",
                        title: "Last Name",
                        width: "110px"
                    },
                    {
                        field: "Country",
                        width: "110px"
                    },
                    {
                        field: "City",
                        width: "110px"
                    },
                    {
                        field: "Title"
                    }
        ]
    };
    var setDataSource = function () {
        if (customerGridDataSource != undefined) {
            return dataSource = new kendo.data.DataSource({
                data: customerGridDataSource,
                schema: {
                    data: function (response) {
                        return response;
                    },
                    total: function (response) {
                        return response.length;
                    },
                    model: {
                        id: "CustomerID",
                        fields: {
                            CustomerID: { editable: false, nullable: false, type: "int" },
                            FirstName: { editable: true, nullable: false, type: "string" },
                            LastName: { editable: true, nullable: true, type: "string" },
                            Country: { editable: true, nullable: true, type: "string" },
                            City: { editable: true, nullable: true, type: "string" },
                            Title: { editable: true, nullable: true, type: "string" }
                        }
                    }
                },
                pageSize: 5,
                serverPaging: false,
                serverSorting: false
            });
        }
        else {
            alert("Data Source undefined. Please Contact Administrator.")
        }
    };
    var onDataBound = function () {        
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    };

    var init = function () {
        gridCustomer = $("#gridCustomer").kendoGrid({
            sortable: true,
            filterable: true,
            pageable: {
                pageSize: 5,
                pageSizes: true
            },
            columns: createColumns(),
            dataSource: setDataSource(),
            dataBound: onDataBound(),
            detailInit: Order.Init()
        });
    };

    return {
        Init: function () {
            init();
        }
    }
})(jQuery,window);

var Order = (function ($,window) {
    var gridOrder = null;
    var dataSource = null;
    var createColumns = function () {
        return [
                { field: "OrderID", width: "70px" },
                { field: "ShipCountry", title: "Ship Country", width: "110px" },
                { field: "ShipAddress", title: "Ship Address" },
                { field: "ShipName", title: "Ship Name", width: "200px" }
        ]
    };
    var setDataSource = function () {
        if (customerGridDataSource != undefined) {
            return dataSource = new kendo.data.DataSource({
                data: customerGridDataSource,
                schema: {
                    data: function (response) {
                        return response;
                    },
                    total: function (response) {
                        return response.length;
                    },
                    model: {
                        id: "CustomerID",
                        fields: {
                            OrderID: { editable: false, nullable: false, type: "int" },
                            ShipCountry: { editable: true, nullable: false, type: "string" },
                            ShipAddress: { editable: true, nullable: true, type: "string" },
                            ShipName: { editable: true, nullable: true, type: "string" }                            
                        }
                    }
                },
                pageSize: 5,
                serverPaging: false,
                serverSorting: false,
                serverFiltering: false,
                filter: { field: "CustomerID", operator: "eq", value: e.data.CustomerID }
            });
        }
        else {
            alert("Data Source undefined. Please Contact Administrator.")
        }
    };    
    var init = function (e) {
        gridOrder = $("<div/>").appendTo(e.detailCell).kendoGrid({            
            scrollable: false,
            sortable: true,
            pageable: true,
            columns: createColumns(),
            dataSource: setDataSource()
        });
    };

    return {
        Init: function (e) {
            init(e);
        }
    }
})(jQuery,window);

$(function () {
    Customer.Init();
});





Atanas Korchev
Telerik team
 answered on 29 Apr 2014
7 answers
758 views
Hola, tengo un problema al enlazar el evento "change" de un combobox, la función del evento jamás se dispara.

El escenario es el siguiente:

El combobox se carga en una vista parcial con sus datos mediante razor

@Html.Kendo().ComboBox().Name("uiCombobox").Filter("contains").Placeholder("Seleccionar...").DataTextField("Nombre").DataValueField("Id").BindTo(Model.Lista).Suggest(true).HtmlAttributes(new {style="width:500px;"})

En la vista padre se realiza el binding del evento change de la siguiente manera:

var comboboxchange= function (e) {
        var id= this.value();
        alert("Id:" + id);
    }

$(document).ready(function () {
        $("#uiCombobox").kendoComboBox();
        var combobox = $("#uiEventos").data("kendoComboBox");
        combobox.bind("change", comboboxchange);
    });

Al escoger una opción en el combobox nunca se despliega la alerta, pueden ayudarme, gracias.



Georgi Krustev
Telerik team
 answered on 29 Apr 2014
1 answer
126 views
Hi Kendo team,
Your DatePicker/ Customizing templates sample doesn't show any icon in Firefox 28.0
I've attached a picture to see this issue.
Kind regards.

Oscar.
Kiril Nikolov
Telerik team
 answered on 29 Apr 2014
1 answer
212 views
I've created a demo to show how the Kendo DropDownList does not behave like a standard HTML select when using a Reset button. After clicking reset you can see the standard HTML select changes back to "Select..." and the Kendo one does not. I haven't been able to come up with a workaround yet either. Help is appreciated

http://trykendoui.telerik.com/EVIS
Georgi Krustev
Telerik team
 answered on 29 Apr 2014
1 answer
144 views
I have set the color of the title in the scheduler,and do not want the  background-color.But it show me the default background-color 'blue'.How to make the background-color transparent ?
Atanas Korchev
Telerik team
 answered on 29 Apr 2014
1 answer
153 views
Hi
I was wandering if anyone has a working example of how to make a async ajax call while dragging an scheduler event. I have a horizontal grouping on different locations (resources in the scheduler) and want to update disabled timeslots on every location while using drag and drop. I have tried a few approaches with moveStart, but none of which made any progress.
Alexander Popov
Telerik team
 answered on 29 Apr 2014
4 answers
1.6K+ views
Is it possible to bind a checkbox in an item template of a ListView to a datasource property without using a edit template.

For example:

<script type="text/x-kendo-tmpl" id="template">
     <div>
       <dl>
         <dt>Name</dt> <dd>${Name}</dd>
         <dt>Age</dt> <dd>${Age}</dd>
         <dt>Checked</dt> <dd><input type="checkbox" data-bind="checked:DataSourceBooleasProperty" /></dd>
       </dl>
     </div>
 </script>

$("#listView").kendoListView({
     dataSource: {
         data: createRandomData(50)
     },
     template: kendo.template($("#template").html())
 });

Alexander Valchev
Telerik team
 answered on 29 Apr 2014
5 answers
938 views
Hello!

I'm developing a MVC4 application and having some trouble with the panel bar. Every time an item is expanded, i need that it's contents get reload from a partial view.

When the panel bar is initialized I set its datasource to the result of an AJAX call that returns JSON with the need properties to populate the panelbar dynamically, and it it's working nicely. The content url comes already prepared in this datasource.

Then I hook up to the select (or expand) event of the panel bar so that I call the reload method. The thing happening is that when the reload method is invoked, partial view get's loaded to the request. The images help to understand this.

Some code:

To get datasource and populate the panelbar

$.getJSON('@Url.Action("GetGrupos", "RegistoFCPlano")/?tipoGrupo=2&data=' + $("#datepicker").val() + '&cg1=' + codGrupo)
        .done(function (json) {
            var panelItems = $.map(json, function (obj) {
                return {
                    text: obj.Codigo,
                    expand: true,
                    contentUrl: obj.Conteudo
                };
            });
 
            $("#panelbar").kendoPanelBar({
                dataSource: panelItems,
                expandMode: "single",
                id: "Codigo",
                select: refreshContent
            }).data("kendoPanelBar");
        })
        .fail(function (jqxhr, textStatus, error) {
            var err = textStatus + ", " + error;
            console.log("Request Failed: " + err);
        });

To refresh the contents
var refreshContent = function () {
        var panelBar = $("#panelbar");
        var item = panelBar.select();
        panelBar.reload(item[0]);
    };

Am I missing something here??
Dimiter Madjarov
Telerik team
 answered on 29 Apr 2014
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
Drag and Drop
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
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?