Telerik Forums
Kendo UI for jQuery Forum
1 answer
189 views

I have implemented the autocomplete item grouping functionality, but need a slightly different implementation.

The first group header item is injected as a disabled item, but the following items are injected as right aligned divs within the list.  This is causing issues because I do not have a lot of width to play with and the items are being overlapped by the injected div's

Is there any way that I can get the control to always inject group headers as disabled items?  I can add a "IsHeader" attribute and doctor the items inline if needed.

I have attached a screenshot displaying the current render

Is this achievable?  Please say it is because I just want one control suite on the site.

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 10 Aug 2016
18 answers
2.3K+ views
I would like to see image previews for files being uploaded similar to what you see here: http://blueimp.github.com/jQuery-File-Upload/ 

How can I do that? Does this require HTML 5 File API support? Is this something on KendoUI roadmap?

Thanks!

Dimiter Madjarov
Telerik team
 answered on 10 Aug 2016
2 answers
1.0K+ views

The TabStrip is not working properly when:

- you hide one or multiple tabs

- then navigate with the keyboard(left/right or up/down arrows)

The content of the hidden tag is then showing during navigation while the tab stays hidden. On Chrome the hidden tab even reappeared!

To reproduce the error I've use the navigation demo of the TabStrip (http://demos.telerik.com/kendo-ui/tabstrip/keyboard-navigation) and added the following line

$($("#tabstrip").data("kendoTabStrip").items()[1]).attr("style""display:none");

as advised in the forum to be able to hide tabs.

 

Christian
Top achievements
Rank 1
 answered on 10 Aug 2016
1 answer
183 views

I propose a fix in TypeScript definition files from:

class DropDownList extends kendo.ui.Widget {
 
        static fn: DropDownList;
 
        options: DropDownListOptions;
 
        dataSource: kendo.data.DataSource;
        span: JQuery;
        filterInput: JQuery;
        list: JQuery;
        ul: JQuery;
 
        element: JQuery;
        wrapper: JQuery;
 
        static extend(proto: Object): DropDownList;
 
        constructor(element: Element, options?: DropDownListOptions);
 
 
        close(): void;
        dataItem(index?: JQuery): any;
        dataItem(index?: number): any;
        destroy(): void;
        focus(): void;
        items(): any;
        enable(enable: boolean): void;
        open(): void;
        readonly(readonly: boolean): void;
        refresh(): void;
        search(word: string): void;
        select(): number;
        select(li: JQuery): void;
        select(li: number): void;
        select(li: Function): void;
        setDataSource(dataSource: kendo.data.DataSource): void;
        text(): string;
        text(text: string): void;
        toggle(toggle: boolean): void;
        value(): string;
        value(value: string): void;
 
    }

to:

class DataBoundWidget extends Widget
{
    dataSource: kendo.data.DataSource;  //or where it should be
}
class List extends DataBoundWidget
{
    dataItem(index?: JQuery): any;  //or where it should be     
    dataItem(index?: number): any;  //or where it should be
}
class Select extends List
{
    setDataSource(dataSource: kendo.data.DataSource): void;  //or where it should be
}
class DropDownList extends Select
{
 
    static fn: DropDownList;
 
    options: DropDownListOptions;
 
    span: JQuery;
    filterInput: JQuery;
    list: JQuery;
    ul: JQuery;
 
    element: JQuery;
    wrapper: JQuery;
 
    static extend(proto: Object): DropDownList;
 
    constructor(element: Element, options?: DropDownListOptions);
 
 
    close(): void;
    destroy(): void;
    focus(): void;
    items(): any;
    enable(enable: boolean): void;
    open(): void;
    readonly(readonly: boolean): void;
    refresh(): void;
    search(word: string): void;
    select(): number;
    select(li: JQuery): void;
    select(li: number): void;
    select(li: Function): void;
    text(): string;
    text(text: string): void;
    toggle(toggle: boolean): void;
    value(): string;
    value(value: string): void;
 
}

This should make sense, since all widgets does not inherits from kendo.ui.widget as your kendo.all.d.ts file defines.

I need a type for variable that lists all widgets that implements dataSource property. I don't want to write:

function myFunction(implementDataSource: kendo.ui.ListView | kendo.ui.DropDownList | kendo.ui.ComboBox | kendo.ui.Grid | kendo.ui...)
{
    implementsDataSource.dataSource.data(something);
}

Stefan
Telerik team
 answered on 10 Aug 2016
1 answer
128 views

So I really love how Telerik does navigation for different examples.  I'm trying to figure out if this is a panelbar or a drawer, so I can replicate similar functionality.  Is there a control that encompasses this type of back and forth/list functionality or is it a matter of cobbling together several controls?

 

 

Iliana Dyankova
Telerik team
 answered on 10 Aug 2016
1 answer
159 views

We are manually configuring the datasource for our Grid Pager. I realize Kendo UI has provisions for this already, but for reasons I'm currently unsure of, we have found we need to manually manage our grid pager and keep it in sync with our grid, which works quite well.

The issue is that when the server returns no data (zero records), I'd like to set the Pager to zero records, but when I do it this way as shown below, I get a Maximum Call Stack Exceeded in the init._valueExpr function on the line that says comparer = new Function('current', 'values', body); Note that line of code is inside a loop and I'm assuming the loop simply runs until the call stack is exceeded, but I'm not sure.

Is there a better way to handle this?

var data = getPagerData(total);
 
if (total > 0) {
    my.gridPager.dataSource.data(data);
} else {
    var empty = [];
    my.gridPager.dataSource.data(empty);
}
 
function getPagerData(length) {
    var pagerData = [];
    for (var i = 0; i < length; i++) {
        pagerData.push({});
    }
 
    return pagerData;
}

 

Harlan
Top achievements
Rank 1
 answered on 09 Aug 2016
1 answer
202 views

I'm developing an ASP.NET 4.5 Web Forms app using the Kendo UI controls in Visual Studio. The controls run fine on my development machine, however when the code is uploaded to the server, the Kendo UI controls do not function as they're supposed to. The attached images show the differences between how the software looks on my development machine versus on the server.

I publish the application from my development machine to the test server using Visual Studio's publish function. Please note that pages that don't use the Kendo UI controls look fine, however pages with Kendo UI components are distorted. My API also works fine. Any ideas as to what's going on? Has anyone seen anything like this before?

 

Nse
Top achievements
Rank 1
 answered on 09 Aug 2016
2 answers
138 views

I have the following code adding xml datasource to a template. The data comes over but is not formatted as a collapse ui. This is in Appbuilder hybrid ui.

<div data-role="view" data-title="Events" data-layout="main" data-model="app.eventView" data-show="app.eventView.onShow" data-after-show="app.eventView.afterShow">
 
    <!-- START_CUSTOM_CODE_eventView -->
    <!-- Add custom code here. For more information about custom code, see http://docs.telerik.com/platform/screenbuilder/troubleshooting/how-to-keep-custom-code-changes -->
    <div class="msf-event-header">
    
    </div>
 
 
            <div id="msf-events" data-use-native-scrolling="true"></div>
 
            <script id="msf-event-template" type="text/x-kendo-template">
                <div data-role="collapsible">
                    <h3><span class="event-title">#= title #</span><span class="event-date">#= date #</span> <span class="event-location">#= location #</span><span></span></span></h3>
                    <p>#= body #</p>
                    <p>
                     <a href="" data-role="button" data-animated="true" clas="km-primary">Add to Calendar</a> <a href="" data-role="button" data-animated="true" clas="km-primary">Get Tickets</a>
                    </p>
                </div>
            </script>
 
 
            <script>
                 
  
                    function onChage() {
                        $("#msf-events").html(kendo.render(template, this.view()));
                    }
 
                    var template = kendo.template($("#msf-event-template").html());
                 
                    var dataSource = new kendo.data.DataSource({
                        transport: {
                            read: "http://msf.bitphaser.com/?q=msf-events"
                        },
                        schema: {
                            type: "xml",
                            data: "/events/event",
                            model: {
                                fields: {
                                    title: "title/text()",
                                    date: "field_date/text()",
                                    location: "field_location/text()",
                                     body: "body/text()",
                                }
                            }
                        },
                        change: onChage
                    });
 
                    dataSource.read();
 
            </script>
 
     
    
    <!-- END_CUSTOM_CODE_eventView -->
</div>

n/a
Top achievements
Rank 1
 answered on 09 Aug 2016
2 answers
1.1K+ views

I have a rest service that returns one field as an array of strings:

 

"$9":"0071", "NAMES": ["Chris Bob","Jim Kuster","Rick Dill","David Scope","Bryan Tim" ]

 

My JS looks like this:

//Set URL of Rest Service
var loc = (location.href);
var url = loc.substring(0,loc.lastIndexOf("/")) + "/xpRest.xsp/xpRest1";

var dataSource = new kendo.data.DataSource({
transport: {
        read: {
            url: url,
            type: 'GET'
        },batch: false
},
pageSize: 15,
});


dataSource.read();


$("#grid").kendoGrid({
dataSource: dataSource,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
height: 543,
noRecords: true,
selectable : false,
columns : [{
field : "$9",
title : "Location",
width : 75
},{
field: "D_APPRNAME",
title : "Approvers"
  }],
}); 
});

The output in the column is [Object][Object]

Does someone have an example or a fiddle to help me with this?
Bryan
Top achievements
Rank 1
 answered on 09 Aug 2016
2 answers
108 views

Thank you in advance for any feedback:

1) Am I defining correctly the parameters to be passed on my vm.audit.load function on the grid data source?

$(document).ready(function () {
    var vm = kendo.observable(fhfa.vm.default({
        container: $("#app-main"),
        appVersion: audit.constants.appVersion
    }));

    //***grid data***
    var o = audit.auditCollection({});
    vm.set("audit", o);

   // kendo.bind($("#app-main"), vm);

 

     $("#grid").kendoGrid({
        //data: vm.audit.load,

        dataSource: {
            p : function(){

                //*** Search criteria values ***
                var auditTypeCB = $("#auditType").data("kendoComboBox");
                auditTypeID: checkIfZeroOrBlank(auditTypeCB.select());

                startDate: checkIfZeroOrBlank($("#sDate").val());
                endDate: checkIfZeroOrBlank($("#eDate").val());

                var applicationCB = $("#appDropDownList").data("kendoComboBox");
                applicationID: checkIfZeroOrBlank(applicationCB.select());

                auditUser: checkIfZeroOrBlank($("#user").val());
                ipAddress: checkIfZeroOrBlank($("#ipAddress").val());
                auditDescription: checkIfZeroOrBlank($("#description").val());

                pageOffset: null;
                pageSize: 0;
                orderBy: null;
                orderByDirection: null
            },
            schema: {
                data: "audit.items"
            },
            transport: {
                read: function (options) {
                    vm.audit.load(p.applicationID, p.auditTypeID, p.auditUser, p.ipAddress, p.startDate, p.endDate, p.auditDescription, p.pageOffset, p.pageSize, p.orderBy, p.orderByDirection, p.pageMax).then(function () {
                        options.success(data);
                    });
                }
            }
        },
        columns: [{
            field: "applicationID",
            hidden: true
        },
        {
            field: "auditTypeID",
            title: "Type"
        },
        {
            field: "auditDate",
            title: "Date",
        },
        {
            field: "applicationName",
            title: "Application",
        },
        {
            field: "auditUser",
            title: "User"
        },
        {
            field: "iPAddress",
            title: "IP Address"
        },
        {
            field: "auditDescription",
            title: "Description"
        }],
        scrollable: true,
        groupable: true,
        reorderable: true,
        sortable: true,
        selectable: true
    });

 

 audit.auditCollection = function (init) {
    var o = fhfa.object.baseCollection(init);
    o._name = "auditCollection"
    o._createObject = function () {
        return audit.audit(init);
    };
    o.onloading = function (args) {
        vm = this;
        kendo.ui.progress(vm._view.element, args.isLoading);
    };
    o.load = function (applicationID, auditTypeID, auditUser, ipAddress, startDate, endDate, auditDescription, pageOffset, pageSize, orderBy, orderByDirection, pageMax) {
        var that = this;

        var vPageSize = 100;
        var vCount = 0;
        var def = $.Deferred();
        that._isLoading = true;

        if (pageSize === 0) {
            pageSize = vPageSize;
        }

        audit.da.auditItems_get(applicationID, auditTypeID, auditUser, ipAddress, startDate, endDate, auditDescription, pageOffset, pageSize, orderBy, orderByDirection, vPageSize, pageMax).done(function(eResult) {
            var items = eResult.d.auditItems;
            vCount = eReResult.d.auditItems.lenght;
            that.set("total", vCount);
            that.addArray(items);

            def.resolve(that);
        }).fail(function (error) {
            if (init.onerror) init.onerror({ source: that, sourceType: that._name, error: error });
            def.resolve(that);
        }).always(function () {
            that._isloading = false;
        });     

        return def.promise();
    };

Rocio
Top achievements
Rank 1
 answered on 09 Aug 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
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?