Telerik Forums
Kendo UI for jQuery Forum
1 answer
230 views

Hello ,

I'm using below code for date validation

 sheetForNPD.range("O2:O100").validation({
        dataType: "date",
        showButton: true,
        comparerType: "between",
        from: "DATEVALUE(\"1/1/1900\")",
        to: "DATEVALUE(\"1/1/2050\")",
        allowNulls: true,
        type: "reject",
        titleTemplate: "Start Date validation error",
        messageTemplate: "Start Date should be between 1899 and 2050 year."
    }).format('MM-dd-yy');

 

But i need if user enter in these format then also acceptable 

    • Slashes

      • M/D/YY

      • M/D/YYYY

      • MM/DD/YY

      • MM/DD/YYYY

    • Dashes

      • M-D-YY

      • M-D-YYYY

      • MM-DD-YY

      • MM-DD-YYYY

    • Dots

      • M.D.YY

      • M.D.YYYY

      • MM.DD.YY

      • MM.DD.YYYY

    Is it possible in kendo spreadsheet can i validate these format for single column ?

Neli
Telerik team
 answered on 27 Sep 2022
1 answer
192 views

Hello,

 

I have applied range validation for numerical type data it's working until i'm entering single record but it's not working when i'm paste multiple record it's not validating please give me any solution.Thank you

 

 sheetForRootCause.range("G2:G300").validation({
        dataType: "number",
        from: "1899",
        to: "2050",
        comparerType: "between",
        allowNulls: true,
        type: "reject",
        titleTemplate: "Year validation error",
        messageTemplate: "Year should be between 1899 and 2050 year."
    });
Neli
Telerik team
 answered on 27 Sep 2022
1 answer
8.6K+ views
Hello,
I have the following problem, many warnings of "Added non-passive event listener to a scroll-blocking 'wheel' event" are generated, to avoid these warnings I have found the following library (https://unpkg.com/default-passive- events@2.0.0/dist/index.umd.js), with this library loaded, it does not throw the warnings, but I was wondering if it is a suitable solution to put a grid in a production environment.

error:



solution: https://unpkg.com/default-passive-events@2.0.0/dist/index.umd.js
Nikolay
Telerik team
 answered on 27 Sep 2022
1 answer
337 views

I use kendoEditor(jQuery) to let user create html content. Then, saving this content as html and using this html content to export to a pdf document by xmlParser. 

I also restricted the width of kendoEditor by A4 page width in order to create a PDF document without fitting problem.

But the problem is the users are not able to know page end so their contents might be split. For example, they create a table and table header in kendoEditor but this table and its header can be split in two pages when exporting to pdf document.

So, is there a way to show page layout or a page end marker or line in kendoEditor?

Neli
Telerik team
 answered on 27 Sep 2022
1 answer
129 views
I've been trying to solve this with functions and the like, but don't seem to be able to find an answer.

Is there anyway I can pass the type field value in the datasource for the foreign key column?
This will allow me to populate the tenantId list based on the type of Row.


toolbar: ["create"], columns: [ { field: "id", title: "Id", hidden: true }, { field: "type", title: "type", hidden: true }, { field: "tenantId", filterable: { multi: true, search: true} ,width: "200px", dataTextField: "name", dataValueField: "id", dataSource: { type: "json", transport: { read: { url: '@Url.Action("GetSyncingTennantsJsn", "dB")', data: { type: ##I want to pass 'type' value for this row## } } } } }, { field: "folder", title: "Folder" },


Many thanks!

Rob

Rob
Top achievements
Rank 2
Iron
Veteran
Iron
 updated answer on 26 Sep 2022
0 answers
342 views
How can I set the stroke width of the circular gauge component? It looks like the width  of the stroke is calulcated relative to the size of the gauge. I would like to increase the stroke width.
Inception
Top achievements
Rank 1
Veteran
 asked on 24 Sep 2022
0 answers
134 views

I have two Kendo Schedulers. In the first one the WorkDayStart and WorkDayEnd should be custom to the day(s) being viewed. They are not static at one single time. If I am viewing one single day, I am sure I could inject some Javascript to find these and update them, then rerender the scheduler. But when viewing a week that would not help. Really they need to be a function. Is this possible?

The second scheduler is grouped by a resource of an Employee. So in this case it is more complicated. I have this one locked down to viewing only a single day view (or other views that don't include slots that may be closed like Agenda). But the columns here are dependent on the employee's availability for the day selected. So again a function is needed.

Alternatively, digging in the kendo.all.js, I see a property called "slotTemplate" but this doesn't seem to be exposed in MVC. Is there a workaround using this?

[EDIT]: I finally found the SlotTemplate as part of the views in MVC. Will play around here and possibly I can solve this on my own.

[EDIT 2]: I did get SlotTemplate working, but the real solution is to fix the WorkDayStart and WorkDayEnd. Let's say this is a program for a store. Bob logs in. Bob sees his own schedule on one tab, and the store schedule on another tab. Bob works different hours per day. The store is open different hours per day. It's not always the same. When viewing a week we need to be expanded to the most open day. When viewing a single day we should match that day.

Here's a SlotTemplate tagged in CSHTML:

views.DayView(v => v.Selected(true)).SlotTemplateId("shopSlotTemplate");
Now, I've actually got three schedules. One shows Bob's schedule or whomever is logged in. This one contains an employee ID to identify Bob. Another one shows the entire store, but it is grouped by the employee ID. Still one more shows the entire store but does not group by employee ID and instead puts everything together. These in respective order are here:
<script id="mySlotTemplate" type="text/x-kendo-template">
   #= getSlotTemplate(data, @loggedInEmployeeId) #
</script>

<script id="shopSlotTemplate" type="text/x-kendo-template">
   #= getSlotTemplate(data) #
</script>

<script id="acSlotTemplate" type="text/x-kendo-template">
   #= getSlotTemplate(data, 0) #
</script>
Next, I added the getSlotTemplate function as follows:

 


function getSlotTemplate(data, employeeId) {

   // Get employee ID if not passed in. If still not found then this scheduler is not grouped this way.
   if (employeeId === undefined) {
      employeeId = data.resources().EmployeeId;
   }

   let isClosed = isShopClosed(shopSchedule.Shop, data.date);

   if ((!isClosed) && (employeeId > 0) && (shopSchedule["Employee" + employeeId] !== undefined)) {
      isClosed = isShopClosed(shopSchedule["Employee" + employeeId], data.date);
   }

   return "<div class=\"" + (isClosed ? "k-nonwork-hour" : "") + "\">&nbsp;</div>";
}
isShopClosed is a function that looks inside a JSON object I've loaded. It contains employee schedules and store schedules. Half days off, full days off, holidays, etc. are all a part of this. It returns a simple boolean. First I'm checking is the store closed, and next I am checking is the employee not working. A DIV is returned with the appropriate Kendo class.

 

This required new CSS since the TD element has margins.

div.k-scheduler-content > table > tbody > tr > td > div {
   margin: -4px -0.5em;
   height: calc(100% + 8px);
   width: calc(100% + 1em);
}

The end result is that the grid for the scheduler appears how I want it.

But working hours are still inaccurate. They are based on a single date and don't change as I move between days.

Paul
Top achievements
Rank 1
Iron
Iron
Veteran
 updated question on 23 Sep 2022
1 answer
530 views

What is returned in variable grid in following code line?

var grid = $("#GridCompetency0").data("kendoGrid");

How do I use to access the fields of my Model?

I am using it in the following onChange function.

function onChange(e)
    {
        var grid = $("#GridCompetency0").data("kendoGrid");
        var categoryColumnStatus;
        alert("onChange");
        var request = $.ajax({
            url: '/Base/GetDisplayStatus',
            type: 'POST',
            dataType: 'JSON',
            data: { categoryColumnStatus: false },
            cache: false,
            success: function (data)
            {
                if (data.categoryColumnStatus)
                {
                    grid.showColumn("FunctionalCategoryName");
                }
                else
                {
                    grid.hideColumn("FunctionalCategoryName");
                }
            }
        });
Nikolay
Telerik team
 answered on 21 Sep 2022
0 answers
128 views

 

Hi, I want to create a bullet chart in the form of group data and set a unique target data, color, tooltip-template for each bar like "column chart" in picture but I can't find how to bind data for bullet chart 

Is there a way to make the chart look like the example? Please advise if there is a more suitable graph format to display this type of data.

 

  var testData3 = [
        { name: "data 1", data: [[200, 350], [150, 170]], color: "#E56997", target: { color: "#E56997" }, tooltip: { template: "#= dataItem #" } },
        { name: "data 2", data: [[210, 250], [190, 300]], color: "#062cda", target: { color: "#062cda" }, tooltip: { template: "#= dataItem.name #" } },
        { name: "data 3", data: [[350, 200], [200, 200]], color: "#fd0166", target: { color: "#fd0166" }, tooltip: { template: "#= value #" } },
        { name: "data 4", data: [[450, 200], [270, 400]], color: "#9F00FF", target: { color: "#9F00FF" }, tooltip: { template: "#= value #" } },
    ]

    $("#testChart").kendoChart({
        title: {
            text: "Bullet",
            font: fontSize
        },
        legend: { visible: false },
        dataSource: {
            data: testData3,
        },
        seriesDefaults: {
            type: "verticalBullet",
            overlay: { gradient: "none" },
            labels: {
                visible: true,
                background: "transparent",
                color: "white"
            },
            tooltip: {
                visible: true,
            }
        },
        series: testData3,
        categoryAxis: {
            categories: ["Jul", "Aug", "Sep"]
        }
    });
Pheeraphong
Top achievements
Rank 1
 updated question on 21 Sep 2022
1 answer
270 views

I have a kendo grid with server side paging and client side sorting. while clicking the sort in the grid, data fetch request(Request to fetch data from server) is getting triggered from frontend. but I'm using the client side sorting it shouldn't be the case. Is it possible to restrict it, without calling the server, Sort should be done in the frontend level. I hereby attach the my code sample images for your Reference. Anyone can point me to the right direction? Thanks.

Georgi Denchev
Telerik team
 answered on 21 Sep 2022
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?