Telerik Forums
Kendo UI for jQuery Forum
5 answers
23.8K+ views
Hi,

Instead of default datasource config/method to load remote data, I am using a custom function to load data and I like to manually show and hide the Grid spinner image.  Is there a way to do this?

Thanks, 
Dimo
Telerik team
 answered on 13 Feb 2017
3 answers
231 views
I use the editor with the following options, because i want to have <br> in my text and no <p>.

   defaultTools["insertLineBreak"].options.shift = false;
   defaultTools["insertParagraph"].options.shift = true;

The problem now is that if I select a part of the tekst to make eg a H1, the total tekst is converted in H1. The  same if I want to make a bullet-list. The different lines of the list are defined by kendo as paragraphs (<p>), while i use <br> to separate the lines. The result is a single bullet for the complete text.

How do i get the possibility of eg bulletlists when i don’t want <p> in my text?

Thanks

Nikolay
Telerik team
 answered on 13 Feb 2017
3 answers
98 views

In one grid i have a dropdownlist editor in one column. When grid load, i see the value but when i edit my row (inline), the value is not selected in dropdownlist. When i click on the arrow dropdownlist expand and close immediatly. What is my problem ?

@* Liste des téléphones *@
        var phoneDs = new kendo.data.DataSource({
            transport: {
                read:  {
                    url: "@Url.Action("ShowPhones", "SupplierInformations")",
                    method: "post",
                    dataType: "json"
                },
                update: {
                    url: "@Url.Action("UpdatePhone", "SupplierInformations")",
                    method: "post",
                    dataType: "json"
                },
                destroy: {
                    url: "@Url.Action("DeletePhone", "SupplierInformations")",
                    method: "post",
                    dataType: "json"
                },
                create: {
                    url: "@Url.Action("AddPhone", "SupplierInformations")",
                    method: "post",
                    dataType: "json"
                },
                parameterMap: function(options, operation) {
                    if (operation !== "read" && options.models) {
                        return {models: kendo.stringify(options.models)};
                    }
                    else
                    {
                        //return options;   
                    }
                }
            },
            batch: true,
            autoSync: true,
            schema: {
                model: {
                    id: "PhoneId",
                    fields: {
                        PhoneId: { editable: false, nullable: true },
                        PhoneNumber: { validation: { required: true,
                            phonevalidation: function (input) 
            {
                                if (input.is("[name='PhoneNumber']")) {
                                    input.attr("data-phonevalidation-msg", "@LocalizationValues.The_Phone_Number_Format_Is_Invalid");
                                                    return /^@RegexHelper.PhoneRegex^/.test(input.val());
                }

                                                return true;
        }
                        } },
                        PhoneExtension: { validation: { required: false,
                            extensionvalidation: function (input) 
                            {
                                if (input.is("[name='PhoneExtension']") && input.val() != "") {
                                    input.attr("data-extensionvalidation-msg", "@LocalizationValues.The_Phone_extension_Is_Invalid");
                                    return /^\d+$/.test(input.val());
                                }

                                return true;
                            }}},
                        PhoneTypes:  { validation: { required: true} },
                        IsEmergency: { type: "boolean" },
                        Type: { validation: { required: true,
                    typevalidation: function (input) 
                    {
                        if (input.is("[name='Type']")) {
                            input.attr("data-typevalidation-msg", "@LocalizationValues.The_Phone_Type_Is_Mandatory");
                                    return (input.val() != "");
                                }

                                return true;
                            }
                } }
    }
                }
            }
        });

        $("#phoneGrid").kendoGrid({
            dataSource: phoneDs,
            pageable: false,
            dataBound: function(e){ },
            pageSize: 99999,
            toolbar: [ {name: "create", text : "@LocalizationValues.Add"}],
            columns: [
                { field: "Type", width: "130px", editor: typeDropDownEditor, title: "Type"},
        {
                field: "PhoneNumber", editor: phoneEditor, title: "PhoneNumber", format: "{0:n}", width: "250px" },
                { field: "PhoneExtension", title:"PhoneExtension", width: "150px", template: '@LocalizationValues.Ext: #: (PhoneExtension == null) ? "" : PhoneExtension#' },
                { command: [{ name : "edit", text: {
                    edit: "@LocalizationValues.Update",
                    update: "@LocalizationValues.Confirm",
                    cancel: "@LocalizationValues.Cancel"
                }},
                { name : "destroy", text: "@LocalizationValues.Remove"}], title: "&nbsp;", width: "250px"}],
            editable: {mode : "inline", confirmation: false},
        });

 

   function typeDropDownEditor(container, options) {
        $('<input name="' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                autoBind: false,
                dataTextField: "Text",
                dataValueField: "Value",
                dataSource: @(New HtmlString(Json.Encode(Model.PhoneTypes)))
        });

Boyan Dimitrov
Telerik team
 answered on 13 Feb 2017
2 answers
174 views

documentation for router change event says that navigation can be canceled with preventDefault

but i want to ask user before leaving current view if is ok to leave unsaved changes.

can be done using promises ?

John
Top achievements
Rank 1
 answered on 13 Feb 2017
1 answer
843 views

Hello,

I have a grid with some cells having a value in multiple lines format. When I tried to export it, the export result set the cell height as a single line.

Is there a way to set the height to auto?

 

Cheers

Pavlina
Telerik team
 answered on 11 Feb 2017
9 answers
2.6K+ views

I am trying  to export a long webpage with many grids and charts to a pdf file with multiple pages. I tried to use the forcePageBreak property but this property breaks the generated pdf. Here is the javascript code of the pdf export:

 exportToPdf:function (){

var className = $(this).data('groupname');

$('.'+className).find('.k-grid-excel').hide();

$('.'+className).find('.removeFromReport').hide();

kendo.drawing.drawDOM($("."+className),

{

forcePageBreak: ".page-break",

margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" },

paperSize: "auto",

landscape: true,

multiPage: true }) .then(function(group) { 

return kendo.drawing.exportPDF(group, { }); }) .done(function(data) {

kendo.saveAs({

dataURI: data,

fileName: "systemReport.pdf",

proxyURL: "//demos.telerik.com/kendo-ui/service/export" });

$('.'+className).find('.k-grid-excel').show();

$('.'+className).find('.removeFromReport').show();

});

}

I will also attach a zip file with the generated pdf with and without the property forcePageBreak.

Is there any other way to achieve the same functionality.

Many thanks in advance

Nisarg
Top achievements
Rank 1
 answered on 10 Feb 2017
2 answers
191 views

I'm using the upload widget in via the MVVM framework, and was wondering if there are any options for me to control the text of the "Select files..." button or specify a drop zone via the data-* attributes. 

If you have any kind of dojo sample for this I would really appreciate it.

Thanks -

Erik

Erik
Top achievements
Rank 2
 answered on 10 Feb 2017
4 answers
132 views

Hi,

http://dojo.telerik.com/IyoVU/6

In this dojo, I'm trying to mix validation tooltips on simple fields, with custom validation on grid columns.  I've used your grid example which validates for the product name beginning with a capital.  Run the example, add a row to the grid, enter a product name that is invalid, e.g. "a" and tab off.  The product validation tooltip message is not shown, when I think it should be.  What am I doing wrong?

 

Thanks,

 

Scott

Stefan
Telerik team
 answered on 10 Feb 2017
3 answers
539 views

Hello Telerik,

 

I have a problem with the kendo.saveAs() because the server, where the binary files come from, requires an 'Authorization' in the request headers.

I have been looking for an answer but all I found was that the question was asked before, by somebody else, on StackOverflow: http://stackoverflow.com/questions/41406918/kendo-server-export-post-request-headers

But no useful answer was given so i pop the question here because I do need an answer for this :(

 

Best regards,

 

Insad

Boyan Dimitrov
Telerik team
 answered on 10 Feb 2017
3 answers
156 views

Hi,

I'm trying to display a partial view in a treelist column 

This is the colum definition:

columns.Add().Field(e => e.PageID)
                .TemplateId("translation-template")                 
                .HtmlAttributes(new { @class = "center col-lg-2" });

 

In this codesnippit, the PageID in the first div is displayed correctly for each row in my treelist.

Now I want to use the #: PageID # to be pass into the Html.RenderAction as a parameter (instead of 4)

<script id="translation-template" type="text/x-kendo-template">
        <div>#: PageID #</div>
        <div>
            @{Html.RenderAction("_TranslationTemplate",
                         "Pages",
                          new { PageID = 4 });
                }
        </div>
    </script>

 

Thank you!

Boyan Dimitrov
Telerik team
 answered on 10 Feb 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?