Telerik Forums
Kendo UI for jQuery Forum
2 answers
224 views

I am trying to create a kendo custom widget in typescript, but the data function always returns null.

let emptyWidget = $('#emptyCriteria').kendoEmptyTemplate().data('kendoEmptyTemplate');
 console.log(emptyWidget) // getting always undefined

 

Widget Code:

interface JQuery {
    kendoEmptyTemplate(options?: KendoWidgets.IEmptyTemplateOptions): JQuery;
    data(key: "kendoEmptyTemplate"): KendoWidgets.EmptyTemplateOptions;
}
 
module KendoWidgets {
 
    export interface IEmptyTemplateOptions {       
    }
 
    export class EmptyTemplateOptions implements IEmptyTemplateOptions{
        name: string = 'EmptyTemplate';
    }
     
    export class EmptyTemplate extends kendo.ui.Widget
    {
        options: EmptyTemplateOptions;
        constructor(element: Element, options: IEmptyTemplateOptions) {
            super(element, options);
        }           
    }
 
    // Create an alias of the prototype (required by kendo.ui.plugin)
    EmptyTemplate.fn = EmptyTemplate.prototype;
    // Deep clone the widget default options
    EmptyTemplate.fn.options = new EmptyTemplateOptions();
    // Create a jQuery plugin.
    kendo.ui.plugin(EmptyTemplate);
}

 

Html:

<div id="emptyCriteria"></div>

 

 

Any of you have encountered this issue or am I missing any methods in widget?

Hash
Top achievements
Rank 1
 answered on 03 Sep 2020
1 answer
89 views
I have been tasked to use the Kendo UI Mobile Scroller widget (https://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/scroller) to hide an element in the dom when scrolling down. I am not sure which method or event I can use to do this. Any help will be so much appreciated. 
Petar
Telerik team
 answered on 03 Sep 2020
1 answer
228 views

Hi,

I have a kendo grid with few locked columns and multiple other columns. When I do navigate grid from other page it's working fine but not when refresh page using using F5 or reload option. Seems width is not set properly, please review atttached snapshots.

 

Alex Hajigeorgieva
Telerik team
 answered on 03 Sep 2020
2 answers
6.6K+ views
I've been searching through documentation and fourms with no luck.

When you create a calendar, it has a default value of null. No date is selected. I want to clear the calendar to no selection progrmaticly. If I send null via the value method it errors out and I couldn't find any other clear method.

is this possible?
todd
Top achievements
Rank 1
 answered on 02 Sep 2020
3 answers
1.4K+ views

I made a simple TreeList.

The data from the server is simple JSON array.

[{"Description":"111","id":1,"Name":"CEO"},{"Description":"222","id":2,"parentId":1,"Name":"Jane"},{"Description":"333","id":3,"Name":"Tom"},{"Description":"444","id":4,"Name":"Susan"}]

TreeList java script  code is below but this always display "No records to display"

When I remove "model" object under "schema" in DataSource It works well.

I don't know what is the problem.

Please help me to solve this proble.

 

var dataSource = new kendo.data.TreeListDataSource({
    transport : {
        read : {
            url: "ReadAsset",
            dataType: "json"
        }
},
        schema: {
            model: {
                id: "id", 
                parentId: "parentId",
                expanded: true
            }
        }
    });


    $("#treelist").kendoTreeList({
        dataSource: dataSource,
        height: "99%",
        columns: [
            { field: "Name" },
            { field: "Description" }
        ]
    });

 

 

Nikolay
Telerik team
 answered on 02 Sep 2020
6 answers
189 views
In the Kendo Tree View component, when you append a new item, the function will return a reference to the new node.  That way, it's easy to build a node hierarchy:
rootNode = myTreeView.append({ text: "MyRoot" }, null);
subNode = myTreeView.append({ text: "MySubNode" }, rootNode);
myTreeView.append({ text: "MyThirdLevelNode1" }, subNode);
myTreeView.append({ text: "MyThirdLevelNode2" }, subNode);

However, I can't find a way to do the same with the Kendo Menu component.  So far, the only I've found to create a menu dynamically is adding a specific ID and getting the menu item with this ID.
MyMenu.append('<li id="RootMenuItem" class="k-item">MyRootItem</li>');
MyMenu.append('<li id="MySubItem" class="k-item">SubItem</li>', $("#RootMenuItem"));

Is there a way to get the newly created item and reuse it as the parent reference for the menu?

Regards,

Simon








Neli
Telerik team
 answered on 02 Sep 2020
6 answers
518 views
The site has a sample code.
http://demos.kendoui.com/web/menu/api.html

With this all clear... Is there a possibility of adding attributes href, class, role? 
Neli
Telerik team
 answered on 02 Sep 2020
3 answers
857 views

Hi,

I have a Grid that is generated dynamically in javascript.

The columns are parametered on the server and I received the configuration in Json. Then I build the Grid as scrollable by default because I can't determine it.

On "databound", I used the "autofit" function to resize each columns. But sometimes, the table width is bigger than the sum of the columns'width and I would like to dispatch the empty width on each columns.

 So, is it possible to resize a column dynamically by setting its width such like that ?

myGrid.columns[0].setWidth("500px");

 

Is it possible to dynamically change the behaviour of a scrollable Grid to a non scrollable Grid ( so that column resizing behaves like if it was initially configured as non scrollable ) ?

 

Thanks for your help,

Regards

Jammer
Top achievements
Rank 1
 answered on 02 Sep 2020
1 answer
128 views

Hi,

I have a problem related to pdf export. If exported view is too long, it's not visible in pdf, and I must zoom it for looking smth (see pdf-export.png). Can I do smth, for example export pdf already zoomed in, and zoom it out if needed? 

Martin
Telerik team
 answered on 02 Sep 2020
1 answer
276 views

Hi, I set the pageSize option on the grid, but I'm having a hard time because it's not shown on the screen.

So I can't see the page selection drop-down even though I deactivated all my csss and enabled only the css and js related to kendo.

What should I check to solve this problem?

I will attach my current screen and my grid creation code.

Help me...

 

$("#dataTable").kendoGrid({
        sortable: true,  
        selectable: true,
        groupable: false,
        scrollable: true,
        dataSource: {
            data: [],
            pageSize : 10
        },
        pageable: {
              pageSizes: [10,50,100]
        },
        columns: [
           { title: "No",  attributes:{style: "text-align: center"}, template: "#= renderNumber(data) #",  width: "50px"},
        { field: "id", title: "SEQ", width: "130px", hidden:true},
        { field: "registDt", title: "일시", width: "160px", attributes:{style: "text-align: center"}, template: '#=registDt==null?" ":new Date(registDt).getDateTime()#' },
        ], 
        //dataBound: resetRowNumber,
    }); 





"registDt
 
 
 
Ivan Danchev
Telerik team
 answered on 01 Sep 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?