Telerik Forums
Kendo UI for jQuery Forum
1 answer
582 views

I have a grid with inline editing, linked to a datasource with a update url like listed below.

How do I catch an error returned by the transport.update ?

Thanks in advance

Regards

Morten

 

$("#grid").kendoGrid({

dataSource: gridDs,

editable: "inline",

...

 

var gridDs = new kendo.data.DataSource({

transport: {

    read: { ... }

    update: { 

                    type: "POST",
                    url: '@Url.Action("Update", "Customers")',
                    dataType: "json",
                    contentType: "application/json; charset=utf-8"

      }

     

 

Alex Hajigeorgieva
Telerik team
 answered on 24 Sep 2019
6 answers
415 views

Hi

Will Kendo UI Scheduler work within Salesforce LockerService?

LockerService Isolation

LockerService is the primary and preferred isolation mechanism for the Lightning Component Framework. LockerService wraps standard objects like window, document, and element inside a secure version of these objects (SecureWindow, SecureDocument and SecureElement) as a way to control access to APIs and regions of the DOM. When components are loaded, they are provided with the secure wrappers (secureWindow and secureDocument) in lieu of the standard objects (window and document). When a component invokes a method on the document or window object, the secure wrapper can apply appropriate security restrictions. For example, access to the DOM of another component will be:

  • Granted if the other component is in the same namespace
  • Denied if the other component is in a different namespace

In addition to providing a sophisticated namespace-based access control mechanism, LockerService enforces a series of rules to further avoid security exploits:

  • JavaScript ES5 strict mode is automatically enabled. Libraries that do not support strict mode will not work with LockerService.
  • Content Security Policy (CSP). unsafe-eval and unsafe-inline are disallowed. Libraries using eval() or inline JavaScript code execution will not work with LockerService.

The rules enforced by LockerService are recognized as industry best practices. However some libraries may not yet work with these restrictions enabled. In that case, we recommend you ask the library author to support strict mode and CSP. In the meantime, you can use the alternative Lightning Container Component isolation described below.

LockerService Advantages

  • No iframe. Components live in the same DOM (better performance)
  • Straightforward, natural communication between components
  • Cohesive UI
  • Eliminates DOM scraping vulnerabilities
  • Mitigates the impact of developer mistakes such as the lack of proper escaping
  • Cross-site scripting (XSS) and template injection are no longer possible
  • Eliminate server-side action invocation/spoofing

LockerService Limitations

  •  Non-compliant libraries will not work with LockerService

https://developer.salesforce.com/blogs/developer-relations/2017/02/lockerservice-lightning-container-third-party-libraries-lightning-components.html

Ianko
Telerik team
 answered on 24 Sep 2019
2 answers
410 views

     Hi, I have a problem with kendo UI grid, the export as PDF works very well, but the export as Excel doesn't work. My code is the following :

@(Html.Kendo().Grid<PRR405Data.Models.MPremiumTransaction>
(Model.Transactions)
.Name("TransactionsDossierPrime")
//.ToolBar(tools => tools.Pdf())
.ToolBar(tools => tools.Template("<a class='k-button k-button-icontext' onclick='exportToPDF()'>" + PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TelechargerPDF + "</a><a class='k-button k-button-icontext' onclick='exportToCSV()'>" + PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TelechargerCSV + "</a>"))
.Pdf(pdf => pdf
.AllPages()
.AvoidLinks()
//.PaperSize("A4")
.Scale(0.8)
//.Margin("2cm", "1cm", "1cm", "1cm")
//.Landscape()
//.RepeatHeaders()
//.TemplateId("page-template")
//.FileName("Kendo UI Grid Export.pdf")
//.ProxyURL(Url.Action("Pdf_Export_Save", "Grid"))
)
.Columns(columns =>
{
columns.Bound(p => p.ENTR_NUM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.NoInscriptionHeader).Width(240).ClientGroupFooterTemplate(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TotalTransactionsAcceptees);
columns.Bound(p => p.BR_CD).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.SuccursaleHeader).Width(90);
columns.Bound(p => p.AGNCY_CD).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CodeAgenceHeader).Width(80);
columns.Bound(p => p.OCCSN_DR).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ConducteurLabel).Width(80);
columns.Bound(p => p.TXN_CD).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CodeTransactionHeader).Width(100);
columns.Bound(p => p.PLCY_TYPE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.IndicateurDeDureeHeader).Width(80);
columns.Bound(p => p.INSUR_NAME).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.NomHeader).Width(250);
columns.Bound(p => p.NIV).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.NIVHeader).Width(180);
columns.Bound(p => p.XFER_DATE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.DebutTransactionHeader).Width(100);
columns.Bound(p => p.EXPIR_DATE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.FinTransactionHeader).Width(100);
columns.Bound(p => p.BUS_TYPE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.GenreAffaireHeader).Width(70);
columns.Bound(p => p.USE_TYPE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.GenreDUtilisationHeader).Width(90);
columns.Bound(p => p.TERR).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ZoneStatistiqueHeader).Width(90);
columns.Bound(p => p.DRIV_AGE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.AgeHeader).Width(60);
columns.Bound(p => p.DRIVING_RC).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.DossierCondRCHeader).Width(80);
columns.Bound(p => p.DRIVING_CL).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.DossierCondCLTRHeader).Width(80);
columns.Bound(p => p.RCLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.RCLimiteHeader).Width(80);
columns.Bound(p => p.RCPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.RCPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.RCCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.RCAnnulHeader).Width(60);
columns.Bound(p => p.TRLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TRFranchHeader).Width(80);
columns.Bound(p => p.TRPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TRPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.TRCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TRAnnulHeader).Width(60);
columns.Bound(p => p.CLLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CLFranchHeader).Width(80);
columns.Bound(p => p.CLPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CLPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.CLCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CLAnnulHeader).Width(60);
columns.Bound(p => p.ADLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ADFranchHeader).Width(80);
columns.Bound(p => p.ADPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ADPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.ADCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ADAnnulHeader).Width(60);
columns.Bound(p => p.RSLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.RSFranchHeader).Width(80);
columns.Bound(p => p.RSPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.RSPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.RSCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.RSAnnulHeader).Width(60);
columns.Bound(p => p.FMLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.FMLimiteHeader).Width(80);
columns.Bound(p => p.FMPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.FMPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.FMCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.FMAnnulHeader).Width(60);
columns.Bound(p => p.ITLIMI_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ITLimiteHeader).Width(60);
columns.Bound(p => p.ITPREM_AM).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ITPrimeHeader).Width(70).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.ITCANCL_C).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ITAnnulHeader).Width(60);
columns.Bound(p => p.TOT_PRE_A).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.PrimeTotaleHeader).Width(60).ClientGroupFooterTemplate("#=sum#");
columns.Bound(p => p.TARIF_STD).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TarifStandardHeader).Width(80);
columns.Bound(p => p.BTCH_CD).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CodeLotHeader).Width(80);
columns.Bound(p => p.BATCH_TYPE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.TypeLotHeader).Width(80);
columns.Bound(p => p.POST_DATE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.DateTransmissionHeader).Format("{0: yyyy-MM-dd}").Width(100);
columns.Bound(p => p.CYCLE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.ReleveHeader).Width(70);
columns.Bound(p => p.CYCLE_DATE).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.DateReleveHeader).Format("{0: yyyy-MM-dd}").Width(100);
columns.Bound(p => p.REJECT).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.CodeRejetHeader).Width(140);
columns.Bound(p => p.WARNINGS).Title(PRR405.Resources.ConsultationHistorique.ConsultationHistorique.AvertissementHeader).Width(300);

})
.Scrollable(s => s.Height("300px"))
.HtmlAttributes(new { style = "margin-bottom:20px;" })
.Sortable()
.Scrollable()
.Events(e => e.DataBound("rejectColor"))
//.Filterable()
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.RCPREM_AM).Sum();
aggregates.Add(p => p.TRPREM_AM).Sum();
aggregates.Add(p => p.CLPREM_AM).Sum();
aggregates.Add(p => p.ADPREM_AM).Sum();
aggregates.Add(p => p.RSPREM_AM).Sum();
aggregates.Add(p => p.FMPREM_AM).Sum();
aggregates.Add(p => p.ITPREM_AM).Sum();
aggregates.Add(p => p.TOT_PRE_A).Sum();
})
.Group(groups => groups.Add(p => p.NIV))
.Group(groups => groups.Add(p => p.OCCSN_DR))
.Read(read => read.Action("Aggregates_Read", "Grid"))
//.Sort(s => s.Add("NuméroSéquence").Descending())
//.Read(read => read.Action("LotsOuvert_Read", "Grid"))
//.Events(e => e.Error("onError"))
))

When the user clicks on the PDF/Excel button, these methods are fired :

// For PDF

function exportToPDF() {
$("#TransactionsDossierPrime").data("kendoGrid").saveAsPDF();
}

// For excel

function exportToCSV() {
        $("#TransactionsDossierPrime").data("kendoGrid").saveAsExcel();
}

 

The method exportToCSV generated an 404 error : "Failed to load resource : the server responded with a status of 404 (Not found)

It seems that te grid doesn't detect that the data are being rendered localy

Thank you for your help

roukfa
Top achievements
Rank 1
 answered on 23 Sep 2019
2 answers
791 views

Hi

I'm using a donut chart with legend in the bottom that can have multiple and variable amount of values. More values make my chart smaller and does not look good at all. Is there any way I can add a scroll in the legend? Or if you have any other option that I can use to be able to see the chart in a fix size and the legend in a fix container will be great

Here is a pic of how it looks now.

Thank you in advance

Claudia
Top achievements
Rank 1
 answered on 23 Sep 2019
3 answers
800 views

     Hi,

I have a situation where I am setting the dataSource of a dropdowntree after defining it (using the setDropDown method). Howerver, I can't seem to be able to clear values from the dropdowntree in this scenario.

I tried to replicate the problem best I could in this dojo: https://dojo.telerik.com/iKoBOVIk/3

Upon selecting item 1 and item 2, if I click the button I want the selected values to be cleared. How can I achieve this?

Thanks.

Ivan Danchev
Telerik team
 answered on 20 Sep 2019
1 answer
890 views

Hi Telerik,

Tooltip not showing if we put chart inside HTML5 fullscreen.

You may refer here for your reference.

Angel Petrov
Telerik team
 answered on 20 Sep 2019
22 answers
713 views

Hello, I have a problem with grid pager translation: pagination buttons tooltips and "items per page" label appear always in english.

I've checked the messages translation scripts are linked and working as you can see in the attached screenshot, and other regions such as grid filters are ok.

What am I doing wrong?

 

Thanks for helping.

Petar
Telerik team
 answered on 20 Sep 2019
1 answer
930 views

1. No load from content?  is that planned.

2. if I try .Content(@<text>@Html.Action("getCompanyForm", "Companies")</text>) it fails spectacularly.  pushes the content out of the content container completely and puts it below the content below the container "outside" in the dom.  I was hoping that i could change the content dynamically by loading a different partial view with a specific parameter.

3. Cannot configure so that it doesn't shrink to icons by default?

Tsvetomir
Telerik team
 answered on 20 Sep 2019
1 answer
298 views

Our target upgrade the KendoUI to latest version  i.e. v2019.2.619 and it can be able to run in VS2019 locally without any issue. However, after the application deployed to IIS server, the icon cannot show properly. I have using browser (Chrome) debug mode to trace and find that the content value in kendo.common.min.css is changed as below in IIS server

.k-i-more-vertical:before {  content: ""; }

 

In BundleConfig.cs, we define the Bundle as below sample code :

            bundles.Add(new StyleBundle("~/bundles/kendoUI").Include(

                "~/Content/styles/kendo.common.min.css",
                "~/Content/styles/kendo.default.min.css"
            ));

 

In addition , we also check the source code in IIS server and the content is correct, here is the sample

.k-i-more-vertical:before {

    content: "\e031"
}

Remark : The DejaVu and glyphs is already added in source code as  ~\Content\styles\fonts\DejaVu and  ~\Content\styles\fonts\glyphs

 

Please advise the possible solution. Thanks you very much. 

 

 

Dimitar
Telerik team
 answered on 20 Sep 2019
1 answer
292 views

HI I'm fairly new to Kendo UI and want to practice using Kendo Grid. I was trying to follow the demo for aggregation and somehow it puts out random number.

I attached output for my program and here is my code:

 

<!DOCTYPE html>
<head>
    <title></title>
    <base href="https://demos.telerik.com/kendo-ui/grid/excel-export">
    <link rel="stylesheet" href="styles/kendo.common.min.css" />
    <link rel="stylesheet" href="styles/kendo.default.min.css" />
    <link rel="stylesheet" href="styles/kendo.default.mobile.min.css" />

    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.all.min.js"></script>


</head>
<body>
    <div id="example">
        <div id="grid"></div>

        <div class="row">
            <div class="col-12">
                <div id="grid"></div>
            </div>
        </div>
    </div>
</body>

        <script>
            $(document).ready(function () {
                var crudServiceBaseUrl = "https://demos.telerik.com/kendo-ui/service",
                
                    dataSource = new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: crudServiceBaseUrl + "/Products",
                                dataType: "jsonp"
                            },
                            update: {
                                url: crudServiceBaseUrl + "/Products/Update",
                                dataType: "jsonp"
                            },
                            destroy: {
                                url: crudServiceBaseUrl + "/Products/Destroy",
                                dataType: "jsonp"
                            },
                            create: {
                                url: crudServiceBaseUrl + "/Products/Create",
                                dataType: "jsonp"
                            },
                            parameterMap: function (options, operation) {
                                if (operation !== "read" && options.models) {
                                    return { models: kendo.stringify(options.models) };
                                }
                            }
                        },
                        batch: true,
                        pageSize: 20,
                        schema: {
                            model: {
                                id: "ProductID",
                                fields: {
                                    ProductID: { editable: false, nullable: true },
                                    ProductName: { validation: { required: true } },
                                    UnitPrice: { type: "number", validation: { required: true, min: 1 } },
                                    Discontinued: { type: "boolean" },
                                    UnitsInStock: { type: "number", validation: { min: 0, required: true } }
                                }
                            }
                        },
                        aggregate: [
                            { field: "UnitPrice", aggregate: "sum" },
                            { field: "UnitsInStock", aggregate: "count"}]
                    });

                $("#grid").kendoGrid({
                    dataSource: dataSource,
                    pageable: true,
                    sortable: {

                        mode: "single",
                        allowUnsort: false
                    },
                    groupable: true,
                    filterable: {
                        mode: "row"
                    },
                    reorderable: true,
                    resizable: true,
                    columnMenu: true,
                    height: 850,

                    toolbar: ["create", "excel", "pdf"],
                    excel: {
                        fileName: "Kendo UI Grid Export.xlsx",
                        proxyURL: "https://demos.telerik.com/kendo-ui/service/export",
                        filterable: true
                    },
                    pdf: {
                    allPages: true,
                    avoidLinks: true,
                    paperSize: "A4",
                    margin: { top: "2cm", left: "1cm", right: "1cm", bottom: "1cm" },
                    landscape: true,
                    repeatHeaders: true,
                    template: $("#page-template").html(),
                    scale: 0.8
                    },


                    columns: [
                        { selectable: true, width: "50px" },
                        { field: "ProductName", title: "Product Name", groupable: true, width: "400px" },
                        { field: "UnitPrice", title: "Unit Price", groupable: true, aggregates: ["sum"], footerTemplate: "Sum: $#= sum#", format: "{0:c}", width: "200px" },
                        { field: "UnitsInStock", title: "Units In Stock", groupable: true, aggregates: ["count"], footerTemplate: "Count: #=count#", width: "200px" },
                        { field: "Discontinued", groupable: true, width: "120px", editor: customBoolEditor },
                        { command: ["edit", "destroy"], title: "&nbsp;", width: "250px" }],
                    editable: "popup"
                });
            });

            function customBoolEditor(container, options) {
                var guid = kendo.guid();
                $('<input class="k-checkbox" id="' + guid + '" type="checkbox" name="Discontinued" data-type="boolean" data-bind="checked:Discontinued">').appendTo(container);
                $('<label class="k-checkbox-label" for="' + guid + '">&#8203;</label>').appendTo(container);
            }
        </script>

 

Thank you!

Hetali
Telerik team
 answered on 19 Sep 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?