Telerik Forums
Kendo UI for jQuery Forum
4 answers
515 views

Hello,

I'm using the following code to export a grid with a few hundred rows:

kendo.drawing.drawDOM($("#resultsGrid"),
    {
        allPages: true,
        avoidLinks: true,
        paperSize: "A4",
        multiPage: true,
        landscape: true,
        margin: { top: "4cm", right: "1cm", bottom: "1cm", left: "1cm" },
        repeatHeaders: true
    }).then(function (documentgroup)
    {
        kendo.drawing.pdf.saveAs(documentgroup, "myfile", "pdf"));
    });

 

The pdf settings on the grid look like this:

pdf: {
    allPages: true,
    repeatHeaders: true
},

 

The grid exports fine but does not repeat the headers on each page.  They are only present on the first page.  Any ideas what would prevent "repeatHeaders: true" from repeating the headers on every page of the exported PDF file?

Thanks,

Jonesy

Stefan
Telerik team
 answered on 21 Apr 2017
1 answer
180 views
Nested Non-Content Editable is removed when pressing "Enter" Key on any content editable.
Try the snippet below on Telerik Demos.
<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <div id="example">
        <div id="editor" rows="10" cols="30" style="height:400px">
            <br />
            <br />
            <p contenteditable="false"><span contenteditable="false">THIS WILL BE REMOVED ( NESTED CONTENT EDITABLE=FALSE)</span></p>
            <p>If you press Enter key when focus on this text the above will be removed.</p>
        </div>
        <script>
            $(document).ready(function() {
                $("#editor").kendoEditor({
                    immutables: true,
                    tools: ["viewHtml"]
                });
            });
       </script>
   </div>
</body>
</html>
Veselin Tsvetanov
Telerik team
 answered on 21 Apr 2017
9 answers
1.2K+ views
I have a nice grid set up your using batch edit demo as an example. However, I would now like to add filtering like in your 'Custom Toolbar' demo. Is there as nice way to still keep the three batch edit buttons and add my own filtering dropdown to the toolbar, or do I now have to code my own add/save/cancel UI for my custom toolbar?

I don't wan't to use the built in filtering because I don't want to have to include the column I filter on as a grid column.

SOLUTION SO FAR:
I have achieved much of what I want by 'manually' moving my filter elements into the grid toolbar, like below:

<style>
    #filter-toolbar
    {
        display: inline-block;
        padding: 5px;
    }
</style>
<script>
    $("#department-grid .k-grid-toolbar").prepend($("#filter-toolbar"));
</script>
<div id="department-grid"></div>
<
div id="filter-toolbar">
    <label>Company: </label>
    @Html.DropDownList("CompanyId", Model.CompanySelectList)
</div>
<div id="department-grid"></div>
Stefan
Telerik team
 answered on 21 Apr 2017
3 answers
490 views
i am working with the web "grid popup editing" and i need to change de tittle of the 
poopup... i need some help... how can i modidy the tittle/label of the popup "edit"?
thanks.



Joseph
Top achievements
Rank 1
 answered on 20 Apr 2017
5 answers
2.0K+ views

Hello,

I am trying to implement a complex grid that has 4 functions defined, on dataBound, columnMenuInit, and 2 on change. We noticed that, when using setOptions/getOptions from local storage, the functionality of our column menu is lost (an error about t[e] not being defined pops up).

Now, I have researched and apparently the JSON.stringify we have to apply before storing does away with the functions, this is, they are lost when setting the options to local storage: however, I was trying to implement a workaround I saw while researching, where basically the function was stored separately, and added after parsing the rest of the options before loading them to the grid again.

My problem now is that the function is getting added to the parsed options object as what I believe is an Unicode string (the representation of it on Chrome dev tools comes up as a string instead of a function). The error thrown when trying to JSON.parse it is that there's a "u" token at position 1, so that's what leads me to think in this way.

My question is: is there any way I can assign the function stored separately on local storage to grid options before applying them to the grid, in order to not lose any functionality? I would be happy just storing and re-adding the columnMenu function (I guess I could extend this to the other ones if it's possible, later on). What would be your advice in this case?

Thank you!

Infraestructura TI
Top achievements
Rank 1
 answered on 20 Apr 2017
1 answer
967 views

The className specified is applied on A tag but not on the right inner SPAN tag

try this code on dojo , see the attached screenshot

<!DOCTYPE html>
<html>
<head>
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
 
</head>
<body>
        <script src="../content/shared/js/people.js"></script>
 
        <div id="example">
            <div id="grid"></div>
 
            <div id="details"></div>
 
            <script>
                var wnd,
                    detailsTemplate;
 
                $(document).ready(function () {
                    var grid = $("#grid").kendoGrid({
                        dataSource: {
                           pageSize: 20,
                           data: createRandomData(50)
                        },
                        pageable: true,
                        height: 550,
                        columns: [
                            { field: "FirstName", title: "First Name", width: "140px" },
                            { field: "LastName", title: "Last Name", width: "140px" },
                            { field: "Title" },
                            { command: { text: "View Details", click: showDetails, className : 'k-icon k-i-copy' }, title: " ", width: "180px" }]
                    }).data("kendoGrid");
 
                    wnd = $("#details")
                        .kendoWindow({
                            title: "Customer Details",
                            modal: true,
                            visible: false,
                            resizable: false,
                            width: 300
                        }).data("kendoWindow");
 
                    detailsTemplate = kendo.template($("#template").html());
                });
 
                function showDetails(e) {
                    e.preventDefault();
 
                    var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
                    wnd.content(detailsTemplate(dataItem));
                    wnd.center().open();
                }
            </script>
 
            <script type="text/x-kendo-template" id="template">
                <div id="details-container">
                    <h2>#= FirstName # #= LastName #</h2>
                    <em>#= Title #</em>
                    <dl>
                        <dt>City: #= City #</dt>
                        <dt>Birth Date: #= kendo.toString(BirthDate, "MM/dd/yyyy") #</dt>
                    </dl>
                </div>
            </script>
 
            <style type="text/css">
                #details-container
                {
                    padding: 10px;
                }
 
                #details-container h2
                {
                    margin: 0;
                }
 
                #details-container em
                {
                    color: #8c8c8c;
                }
 
                #details-container dt
                {
                    margin:0;
                    display: inline;
                }
            </style>
        </div>
 
 
</body>
</html>

 

Preslav
Telerik team
 answered on 20 Apr 2017
1 answer
2.1K+ views

Hi,

I am developing a MVC Project with kendo ui. One of the requirement is to filter blank values in grid columns. The filter option should be a part of existing filter options present with column headers. How can we implement the same?

Tsvetina
Telerik team
 answered on 20 Apr 2017
1 answer
269 views
I cannot get the DatePicker Popup to sit on the top of the grid, it seems to cut off at the footer. I've tweaked with the CSS to no avail. Has anyone had any luck?
Georgi Krustev
Telerik team
 answered on 20 Apr 2017
3 answers
92 views

How can we customize kendo grid filter options "Is empty","Is not empty" etc like the code which is mentioned below.

.Filterable(filter => filter.Mode(GridFilterMode.Menu).Extra(false)
                                                 .Operators(oper => oper.ForString(str => str.Clear()
                                                                                  .IsEqualTo("Is equal to")
                                                                                  .Contains("Contains")
                                                                                  .StartsWith("Starts with")
                                                                                 )))
                   

Dragomir
Telerik team
 answered on 20 Apr 2017
1 answer
130 views

Hello,

can anyone tell me why the dropdown not fits when filtering("contains") ??

1.@(Html.Kendo().DropDownListFor(m => m.Planstelle).BindTo(Model.AvailablePlanstellen)
2.                                 .Filter("contains")
3.                                 .HtmlAttributes(new { style = "width: 100%; margin-right: 10px" }))

 

 

this makes me crazy ^^

 

Best Regards

 

 

Ivan Danchev
Telerik team
 answered on 20 Apr 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?