Telerik Forums
Kendo UI for jQuery Forum
3 answers
454 views

Hello,

we use Kendo Ui for ANgualr 2 grid with sorting. Out of the box the column with sorting enabled can be in 3 possible states: sorted asc, sorted desc or not sorted. chages in grid sorting update boutd sort property wit current array of SortDescriptors. When column is sorted  SortDescriptor is added to array of Sortdescriptors and specifies the field and direction of sort.

If column is not sorted it should not be present in SortDescriptor array. However if column is clicked until it is unsorted again, its SortDesriptor stays in array with direction 'undefined'. This is incorrect, it should disappear from array. Also according to Kendo type definition direction can only have value 'asc' or 'desc' but not 'undefined' 

Dimiter Topalov
Telerik team
 answered on 11 Aug 2017
1 answer
2.5K+ views

Hello, I hope someone can help me out with this problem I am struggling with.

I am attempting to use a multi select as an editor for a column within my grid. This column itself is actually an object which I use a template to display the text content within the grid:

"accountReps": {
            "primary": [{
                "userId": 1234,
                "name": "Person name"
            }],
            "secondary": []
        }

 

These properties are also both set as editable in the schema model

"accountReps.primary": {
    "type": "object",
    "editable": true,
    "nullable": false,
    "validation": {
        "required": false
    }
},
"accountReps.secondary": {
    "type": "object",
    "editable": true,
    "nullable": false,
    "validation": {
        "required": false
    }
}

 

When its comes to the editor I can display the editor and populate the initial values fine, but when persisting back to the grid the data is not to be mapping to my object correctly. The code I am using for the editor is:

 

$('<select name="' + options.field + '"/>')
    .appendTo(container)
    .kendoMultiSelect({
        placeholder: "Select",
        autoBind: false,
        dataTextField: "Name",
        dataValueField: "Id",
        valuePrimitive: true,
        dataSource: ds,
        change: function(e) {
            console.log('change');
        },
        select: function(e) {
            console.log('select');
        },
        dataBound: function () {
            var fieldValues = options.model.get(options.field).map(function (item) {
                return item.userId.toString();
            });
            this.value(fieldValues);
        }
    });

 

I believe its just setting the selected ids as the value for my column. I'm hoping for an event I can use to set the value correctly or a way to map the object.

Any help would be much appreciated.

John

Stefan
Telerik team
 answered on 11 Aug 2017
9 answers
803 views

I have a need to do the following two things with my grid's column filter menu dropdown checkboxes:

1) Sort the checkboxes alphabetically by their value (by default the are sorted by the grid's datasource sort value).

2) Filter all other column's checkbox values based on the filter selection of the first checkbox.

 

I found examples on here which show how to do each of these things, but when combined together I'm noticing that, because the grid and the filter menu share the same datasource, as soon as the filter menu is opened and the checkboxes are sorted/displayed, the entire grid is sorted as well.

 

I've created an example here: http://dojo.telerik.com/@mcook103/oxilA

Stefan
Telerik team
 answered on 11 Aug 2017
2 answers
142 views

Hello Everyone,

I want to apply the group property to only week view and keep it default for day and month. How can I that?

Thanks

Rahul

Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2017
1 answer
2.5K+ views

Hi Teachers

I am using Kendoui in asp.net core for reporting for pdf and excel.Report pdf have problem for motherland language not display in export file .pdf.I am add  pdf export code of index.chtml file look like this

<h2>PDF Report Kendo UI Layout Tutorials</h2>

<style>
    /*
            Use the DejaVu Sans font for display and embedding in the PDF file.
            The standard PDF fonts have no support for Unicode characters.

            The font-face is declared in the Kendo UI stylesheets.
        */
    @@font-face {
        font-family: "MyanmarLanguage";
        src: url("~/Fonts/Zawgyi-One.ttf") format("truetype");    
    }

    .k-grid {
        /*font-family: "DejaVu Sans", "Arial", ''sans-serif'';*/
        font-family: ''MyanmarLanguage'';
   
    }
   
    /* Hide the Grid header and pager during export */
    .k-pdf-export .k-grid-toolbar,
    .k-pdf-export .k-pager-wrap {
        display: none;
    }
</style>


<div class="box wide">
    <p style="margin-bottom: 1em"><b>Important:</b></p>

    <p style="margin-bottom: 1em">
        This page loads
        <a href="https://github.com/nodeca/pako">pako zlib library</a> (pako_deflate.min.js)
        to enable compression in the PDF. This is highly recommended as it improves
        performance and rises the limit on the size of the content that can be exported.
    </p>

    <p>
        The Standard PDF fonts do not include Unicode support.

        In order for the output to match what you see in the browser
        you must provide source files for TrueType fonts for embedding.

        Please read the documentation about
        <a href="http://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom#custom-fonts-and-pdf">custom fonts</a>
        and
        <a href="http://docs.telerik.com/kendo-ui/framework/drawing/pdf-output#using-custom-fonts">drawing</a>.
    </p>
</div>

<script type="x/kendo-template" id="page-template">
    <div class="page-template">
        <div class="header">
            <div style="float: right">Page #: pageNum # of #: totalPages #</div>
            Multi-page grid with automatic page breaking
        </div>
        <div class="watermark">ပိုင္စိုးသူ</div>
        <div class="footer">
            Page #: pageNum # of #: totalPages #
        </div>
    </div>
</script>

<div>
    @(Html.Kendo().Grid<EPGEKendoUI.Models.TestViewModel>()
        .Name("grid")
        .ToolBar(tools => tools.Pdf())
        .Pdf(pdf => pdf
            .AllPages()
            .AvoidLinks()
            .PaperSize("A4")
            .Margin("2cm", "1cm", "1cm", "1cm")
            .Landscape()
            .RepeatHeaders()
            .TemplateId("page-template")
            .FileName("Kendo UI Grid Export.pdf")
            .ProxyURL(Url.Action("ExcelSave", "Grid"))
        )
        .Columns(columns =>
        {
            columns.Bound(p => p.Name);
            columns.ForeignKey(p => p.GenreId, (System.Collections.IEnumerable)ViewData["genres"], "Id", "Name").Title("Genre");
            columns.ForeignKey(p => p.RatingId, (System.Collections.IEnumerable)ViewData["ratings"], "Id", "Name").Title("Rating");
            columns.ForeignKey(p => p.ShopLocationId, (System.Collections.IEnumerable)ViewData["location"], "Id", "Location").Title("ShopLocation");
        })
        .HtmlAttributes(new { style = "height: 550px;" })
        .Scrollable()
        .Groupable()
        .Sortable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("ExcelRead", "Excel"))
            .PageSize(20)
        )
    )
</div>

<style>
    /* Page Template for the exported PDF */
    .page-template {
        /*font-family: "DejaVu Sans", "Arial", sans-serif;*/
        font-family : ''MyanmarLanguage'';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }

        .page-template .header {
            position: absolute;
            top: 30px;
            left: 30px;
            right: 30px;
            border-bottom: 1px solid #888;
            color: #888;
        }

        .page-template .footer {
            position: absolute;
            bottom: 30px;
            left: 30px;
            right: 30px;
            border-top: 1px solid #888;
            text-align: center;
            color: #888;
        }

        .page-template .watermark {         
            font-weight: bold;
            font-size: 400%;
            text-align: center;
            margin-top: 30%;
            color: #ff0000;
            opacity: 0.1;
            transform: rotate(-35deg) scale(1.7, 1.5);
        }

    /* Content styling */
    .customer-photo {
        display: inline-block;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-size: 32px 35px;
        background-position: center center;
        vertical-align: middle;
        line-height: 32px;
        box-shadow: inset 0 0 1px #999, inset 0 0 10px rgba(0,0,0,.2);
        margin-left: 5px;
    }

    .customer-name {
        display: inline-block;
        vertical-align: middle;
        line-height: 32px;
        padding-left: 3px;
    }
</style>


Pleas help me and see out put pdf file attached.

 



Stefan
Telerik team
 answered on 11 Aug 2017
3 answers
145 views

Hi,

 

I'm struggling to center my text inside a Diagram box. I followed this example, but it still doesn't work. Here's my code :

 

The diagram

The visualTemplate function

 

 

 

 

 

Stefan
Telerik team
 answered on 11 Aug 2017
2 answers
127 views

I'm not sure if this is a recent issue, or if it's always been there, I'd swear it was working before but maybe I'm mistaken.

If this is a known issue please disregard.

In Excel or Google sheets, if you make a rectangular selection of a range, you can edit a value, hit the TAB key, edit the next value, and the selection within the selection will move within your rectangle, allowing you to edit each cell in the range.

Currently, in the Kendo UI spreadsheet, for some reason, if you enter a value for one cell, it makes that value the value for ALL cells in the selection.

Steps to reproduce:

  1. Jump to one of the spreadsheet demos: http://demos.telerik.com/kendo-ui/spreadsheet/index
  2. Select a rectangular range.
  3. Type in "ABC".
  4. Notice all cells get changed to "ABC".
  5. Hit tab to edit the next cell.
  6. Type in "123"
  7. Notice all cells get changed to "123".

The issue:

Unlike Excel or Google Sheets, and this seems problematic, editing a single cell within a multi-cell range causes all cells to change to that value, rather than allowing individual cell editing via the TAB and ENTER keys.

Christopher
Top achievements
Rank 2
Iron
 answered on 10 Aug 2017
3 answers
3.1K+ views

UPDATE
After two days of googling I found the solution in this example:
http://jsfiddle.net/krustev/9qZnp/ 

I adapted it to my own code, and it works perfectly.

KR

Henk Jelt

END UPDATE

Hi

I have two dropdown lists.
One contains a list of customers. 
The second should contain a list of products for the selected customer.
Both are populated by calls to json-webservices.
The selection process works fine via postback (I cannot get cascading dropdownlists working...).

It works like this:
I select an option in the first dropdownlist, which is part of a form.
Then I invoke a postback, retrieve the value of the selected item in the dropdownlist, and use this to dynamically adapt the json call to retrieve the data for the second dropdownlist.
This works fine: the second dropdownlist is populated ok.

The problem I have is that the selected item in the first dropdownlist gets lost.
I want it to come back but have no clue how.

I am working in an MVC environment, so I save the value in a viewdata-object, which I can re-use in the view.

Which steps do I need to take to have the selected option in view?

KR

Henk Jelt Hoving
Graham
Top achievements
Rank 2
Iron
Iron
 answered on 10 Aug 2017
2 answers
316 views

Cross posting from dropdownlist widget

Both widgets(potentially others) seem to have the same issue in MS Edge. Their popup will appear, then immediately disappear.

Ivan Danchev
Telerik team
 answered on 10 Aug 2017
1 answer
395 views

Cross posting

It looks like combobox has the same issue as the other widgets.

Ivan Danchev
Telerik team
 answered on 10 Aug 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?