Telerik Forums
Kendo UI for jQuery Forum
7 answers
2.3K+ views

In my project, I used Kendo Editor, Kendo DateTimePicker, Kendo Sortable and Kendo Upload. I want to apply the Content Security Policy for my site. And I met some problem about it.

According to the link: http://docs.telerik.com/kendo-ui/troubleshoot/content-security-policy, I have to use the 'unsafe-eval'.

But after I added the 'unsafe-eval', there still are errors about inline style, inline script and script URL. Please check the attached files.

After I added the 'unsafe-inline' to script-src and style-src, then all errors disappeared.

Just want to ask if the 'unsafe-inline' for script and style must be used for Kendo UI? Will Kendo UI support the strict Content Security Policy in the future?

Aleksandar
Telerik team
 answered on 15 Dec 2020
6 answers
987 views
I was looking for a property to set the stepsize on the value axis. By this I mean instead of (0, 10, 20, 30 ... 90, 100) to specify 0, 25, 50, 75, 100 on the value axis.

Is this possible and if so what property should I use?

Thanks

Roel Hans
Alex Hajigeorgieva
Telerik team
 answered on 14 Dec 2020
13 answers
1.5K+ views
There is a bug when binding a grid using MVVM, the dropdownlist in the pager is set to display:none because the grid is initialized twice.
The first time it creates the dropdownlist and sets the <select /> to display:none, the second time it copies the display:none style to the already created dropdownlist.

http://jsfiddle.net/TQLZT/6/
Alex Hajigeorgieva
Telerik team
 answered on 14 Dec 2020
1 answer
147 views

hello, 

When you make a grid scrollable it appears to create 2 tables one for the head and one for the body. This causes the WAVE tool to see the body table as a layout table, which can cause issues for screen readers. Is anyone able to confirm that making a grid scrollable still confirms with WCAG AA standard?

 

Thank you

Jack

Eyup
Telerik team
 answered on 14 Dec 2020
1 answer
101 views

Is it possible to resize image by dragging similar to crop is doing?

It would be nice addition.

Aleksandar
Telerik team
 answered on 11 Dec 2020
1 answer
2.2K+ views

Hi,

We have recently changed some legacy code which was calling a WCF API to populate the grid and it was using serverside paging. We have to use the same serverside paging but with C# datasource. How can we achieve this?

This is how the code was before when it used an API:
dataSource: {
    type: "odata",
    transport: {
        read: dataUrl,
        dataType: "json"
    },
    schema: {
        model: BillingModel,
        data: function (data) {
            return data["value"];
        },
        total: function (data) { return data['odata.count']; }
    },
    serverPaging: true,
    serverFiltering: true,
    serverSorting: true,
    sort: { field: "EncounterDate", dir: "asc" }
}

This was changed to use the c# datasource now:

dataSource: {
    schema: {
        model: BillingModel,
    }
}

Anton Mironov
Telerik team
 answered on 11 Dec 2020
7 answers
4.4K+ views
Hello Forum:

I have a Kendo UI button in a header of a layout, and I would like to hide it using jQuery:

$("#option-button").css('display', 'none');

But the button doesnt hide, is there any way to hide it using a specific function in Kendo UI?

I will appreciate any help.

Thanks!
Nithya
Top achievements
Rank 1
 answered on 10 Dec 2020
4 answers
162 views
I am having hard time implementing server side pagination using Kendo UI Grid. I have a POST route `/worklist` that does return results when I supply params to it but I am unable to use it using the Kendo UI grid, I have searched a lot online but I cant find anything useful. Here is the result that is returned by the URL when I use Postman to supply params to it. 

    {"header":{"cursor":{"pageable":{"sort":null,"offset":0,"pageSize":5,"pageNumber":0},"page":0,"size":5,"numberOfElements":5,"totalElements":26315,"totalPages":5263},"filter":{"dobFrom":null,"dobTo":null,"inFacility":null,"inICURoom":null,"isICUBaby":null,"hasDocumentWaitingApproval":null,"hasNotification":null,"statusInfoCompleted":false,"statusToBeScreened":false,"statusConsentRequired":false,"statusSecondScreeningDateRequired":false,"statusSecondScreeningDateGiven":false,"statusAppointmentDateRequired":false,"statusAppointmentDateGiven":false,"statusReferredToENT":false,"statusFirstHourOfRehabGiven":false,"statusHaRecommended":false,"riskFactorCode":null,"facilityFollowingPatient":true,"readyToBeScreened":false,"restrictToMyPatientList":false}},"rows":[{"patientId":43101,"patientName":"LAUZON, FLORENCE","sex":"F","statusIcon":"KARAN_ICON","birthDate":"2014-07-22","decesedDate":null,"ramq":"LAUF14572215","mrn":"3009796","mrnFacilityCode":"CHUSJ","followUpFacilityCode":"CHUSJ","location":null,"age":"6 ans 4 mois","motherMaidenName":null,"phoneNumber":"(514)260-8227","address":"1425 RUE UNION","city":"SAINTE-CATHERINE","postalCode":"J5C 1G8","status":"Réussite - fin du PQDSN","statusDate":"2014-08-12"},{"patientId":43102,"patientName":"BETOURNAY, KEITH","sex":"M","statusIcon":"KARAN_ICON","birthDate":"2014-08-18","decesedDate":null,"ramq":"BETK14081812","mrn":"3010677","mrnFacilityCode":"CHUSJ","followUpFacilityCode":"CHUSJ","location":null,"age":"6 ans 3 mois","motherMaidenName":null,"phoneNumber":"(514)451-7657","address":"1735 RANG DUMAS","city":"ORMSTOWN","postalCode":"J0S 1K0","status":"Réussite - fin du PQDSN","statusDate":"2014-08-24"},{"patientId":43103,"patientName":"BETOURNAY, MARLY","sex":"F","statusIcon":"KARAN_ICON","birthDate":"2014-08-18","decesedDate":null,"ramq":"BETM14581814","mrn":"3010678","mrnFacilityCode":"CHUSJ","followUpFacilityCode":"CHUSJ","location":null,"age":"6 ans 3 mois","motherMaidenName":null,"phoneNumber":"(514)451-7657","address":"1735 RANG DUMAS","city":"ORMSTOWN","postalCode":"J0S 1K0","status":"Réussite – surveillance en audiologie recommandée","statusDate":"2014-09-04"},{"patientId":43104,"patientName":"CLIMACO-DOS SANTOS, MATHEO","sex":"M","statusIcon":"KARAN_ICON","birthDate":"2014-07-21","decesedDate":"2015-03-24","ramq":"CLIM14072117","mrn":"3011417","mrnFacilityCode":"CHUSJ","followUpFacilityCode":"CHUSJ","location":null,"age":"6 ans 4 mois","motherMaidenName":null,"phoneNumber":"(438)403-2806","address":"1448, RUE TARDIVEL","city":"LAVAL","postalCode":"H7K 0C2","status":"Décédé","statusDate":"2015-03-24"},{"patientId":43105,"patientName":"CHAGNON, BB DE SINDY","sex":"F","statusIcon":"KARAN_ICON","birthDate":"2014-08-04","decesedDate":null,"ramq":null,"mrn":"3011180","mrnFacilityCode":"CHUSJ","followUpFacilityCode":"CHUSJ","location":null,"age":"6 ans 4 mois","motherMaidenName":null,"phoneNumber":"(450)793-2578","address":"72 DION","city":"SAINT-LIBOIRE","postalCode":"J0H 1R0","status":"Réussite – surveillance en audiologie recommandée","statusDate":"2014-09-04"}]}
This is the result when explicitly mention that I need the first five results , how can I display this through kendo UI Grid, I am using the `pageSize` and the `total` records variable but no luck. 
Here is my jQuery Kendo UI code

    $('#grid').kendoGrid({
            dataSource: {
                transport: {
                    read: function (options) {
                       $.ajax({
                           type: "POST",
                           contentType: "application/json",
                           url: "worklist",
                           dataType: 'json',
                           cache: false
                       })
                    }
                },
                serverPaging: true,
                timeout: 600000,
                pageSize: 10,
            },
            schema: {
                total: '26315',
                model: {
                    fields: {
                        patientName: { type: 'string'},
                        birthDate: { type: 'string'},
                        phoneNumber: { type: 'string'},
                        ramq: { type: 'string'},
                        address: { type: 'string'},
                        mrn: { type: 'string'}
                    }
                }
            },
            height: 550,
            filterable: true,
            sortable: true,
            pageable: true,
            columns: [
                {
                    field: "patientName",
                    title: 'Patient name'
                },
                {
                    field: "birthDate",
                    title: 'BirthDate'
                },
                {
                    field:"ramq",
                    title:"RAMQ"
                },
                {
                    field:"address",
                    title: "Address"
                },
                {
                    field:"mrn",
                    title: "MRN"
                }]
        });

    });

using this, in my network tab I keep getting a 404 Not found, apparently the library is not supplying any params to the request, however I do see the empty Kendo UI grid being displayed on the page.Thanks for the help
Anton Mironov
Telerik team
 answered on 10 Dec 2020
5 answers
1.8K+ views

I am using the following JSON data in my Kendo ListView DataSource:

[
  {
    "Id": 2,
    "Name": "My Name",
    "Address": "123 Sesame Street",
    "City": "My City",
    "State": "MO",
    "ProductTypes": [
      {
        "Id": 2,
        "Name": "Cage Free"
      },
      {
        "Id": 3,
        "Name": "Free-Trade"
      },
      {
        "Id": 4,
        "Name": "GAP"
      },
      {
        "Id": 6,
        "Name": "Grass Fed"
      }
    ]
  }
]

 

Now here is my goal/issue. I would like to filter the datasource when a checkbox is checked and the field I would like to filter by is the `ProductTypes.Name` field.

However, I'm not sure how to get this working correctly.

Here is my DataSource:

profileDataSource: new kendo.data.DataSource({
    transport: {
        read: {
            url: "/Profile/GetAllProfiles",
            dataType: "json"
        }
    },
    schema: {
        model: {
            fields: {
                Id: { type: "number", editable: false, nullable: true },
                Name: { type: "string" },
                ProductTypes_Name: { type: "string", from: "ProductTypes.Name" }
            }
        }
    }
})

 

And here is how I'm currently trying to filter but it's not working:

$("#profileCertificationsListView").on("click", "input[type=checkbox]", function() {
    viewModel.profileDataSource.filter({
        filters: [
            { field: "ProductTypes_Name", operator: "eq", value: $(this).attr("name") }
        ]
    }
});

 

If I check the checkbox that has the name "Cage Free" for example, all of the items in the listview are hidden.

Misho
Telerik team
 answered on 10 Dec 2020
5 answers
342 views
I have a grid that has a few column templates defined.  Some are using data-bind="click: clickHandler" and some have custom and kendo widgets within them.  When I use a DataSource making a remote data call, it seems like the kendo.bind() is not being applied to the rows in the column.

JS Fiddle example here which has an "Action" column with a simple data-bind click handler that will not fire:
http://jsfiddle.net/jeastburn/VgtDM/

I found I can call kendo.bind() on the dataBound Grid event, but this feels like a hack and I lose the ability to have data-bind events pass the row data rather than my top-level Observable object I use in the bind() call..
Ivan Danchev
Telerik team
 answered on 10 Dec 2020
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?