Telerik Forums
Kendo UI for jQuery Forum
0 answers
3 views

let me explain what issue i am facing , i have two cloumns in kendogrid one is dropdown and other is simple textbox

let say dropodown column has (emailadress, website dropdown) now i want to match the exact expression of mail to the other column

if it matches then save the record if not matches than show the toolptip and prevent for saving changes

this is the code

save: function(e) {
                                    // Get the data item being saved
                                    var dataItem = e.model;

                                    // Access properties of the data item and perform actions accordingly
                                    var addressType = dataItem.intInternetAddressTypeID;
                                    var inputField = dataItem.strInternetAddress;

                                    // Perform validation or other actions based on the properties
                                    if (addressType === "2") {
                                        // Email validation for input field
                                        var emailRegex = /^[^\s@@]+@@[^\s@@]+\.[^\s@@]+$/;
                                        if (!emailRegex.test(inputField)) {
                                            // Set validation message on the corresponding cell
                                            e.container.find("[name=strInternetAddress]").closest("td").attr("data-strInternetAddress-msg", "Invalid email address format");
                                            e.preventDefault(); // Prevent saving the record
                                        }
                                    } else if (addressType === "10") {
                                        // Phone number validation for input field
                                        var phoneRegex = /^[0-9]+$/;
                                        if (!phoneRegex.test(inputField)) {
                                            // Set validation message on the corresponding cell
                                            e.container.find("[name=strInternetAddress]").closest("td").attr("data-strInternetAddress-msg", "Invalid phone number format");
                                            e.preventDefault(); // Prevent saving the record
                                        }
                                    }
                                },

i also enable the tooltip from databound
dataBound: function (e) {
   e.sender.element.find("[data-strInternetAddress-msg]").each(function () {
                                    $(this).kendoTooltip({
                                        position: "bottom",
                                        content: $(this).attr("data-strInternetAddress-msg"),
                                    });
                                });
}but tooltip is not showing in the page , it preventing from saving but not showing tooltip after inspection i found that it creating this html

<td role="gridcell" data-container-for="strInternetAddress" data-strinternetaddress-msg="Invalid email address format"><input type="text" class="k-input k-textbox k-valid" name="strInternetAddress" required="required" data-required-msg="Internet Address is required" data-bind="value:strInternetAddress"></td>


Help me how to show the tooltip not alert i dont want alert

saurabh
Top achievements
Rank 1
 asked on 17 Apr 2024
0 answers
8 views

 

 

https://dojo.telerik.com/ahoKociN/2

 

 

1) normal select box : (in the iPAD)

<select id="size0" >
    <option>S - 6 3/4"</option>
    <option>M - 7 1/4"</option>
    <option>L - 7 1/8"</option>
    <option>XL - 7 5/8"</option>
</select>

 

2) kendo ui select box :

 

  Question : 

How can I input like 1) on mobile while using kendo jquery?

 

n/a
Top achievements
Rank 1
Iron
Iron
 asked on 30 Mar 2024
3 answers
26 views

Hello,

I am using Kendo version Kendo UI v2020.2.617 in our project, I have implemented custom fonts in the fonts family tool. When I select any text to change its font for some instances, the selection gets held until the time I select the font and after the font selection is completed. Still, when I select the text and try to open the font dropdown, the selection is getting deselected, which means the selection is not getting hold in the editor.

Even I faced the same issue for the default fontName tool when I implemented it before trying the custom.

Will you please help me with what might be the possible reasons for it? 

 

Code which I implemented -

{
                    name: "fontName",
                    items: [{
                        text: "Andale Mono",
                        value: "Andale Mono"
                    }, {
                        text: "Arial",
                        value: "Arial"
                    }, {
                        text: "Arial Black",
                        value: "Arial Black"
                    }, {
                        text: "Book Antiqua",
                        value: "Book Antiqua"
                    }, {
                        text: "Comic Sans MS",
                        value: "Comic Sans MS"
                    }, {
                        text: "Courier New",
                        value: "Courier New"
                    }, {
                        text: "Georgia",
                        value: "Georgia"
                    }, {
                        text: "Helvetica",
                        value: "Helvetica"
                    }, {
                        text: "Impact",
                        value: "Impact"
                    }, {
                        text: "Symbol",
                        value: "Symbol"
                    }, {
                        text: "Tahoma",
                        value: "Tahoma"
                    }, {
                        text: "Terminal",
                        value: "Terminal"
                    }, {
                        text: "Times New Roman",
                        value: "Times New Roman"
                    }, {
                        text: "Trebuchet MS",
                        value: "Trebuchet MS"
                    }, {
                        text: "Verdana",
                        value: "Verdana"
                    }, {
                        text: "Webdings",
                        value: "Webdings"
                    }, {
                        text: "Wingdings",
                        value: "Wingdings"
                    }]
                }

Thank you

 

 

Sameep
Top achievements
Rank 1
Iron
 answered on 14 Feb 2024
1 answer
31 views
I have been asked to add tooltips to a dropdownlist so a user can see more details about an item before selecting it. I found this solution https://docs.telerik.com/kendo-ui/knowledge-base/show-tooltip-for-items but it doesn't work right on touch devices. When you touch the screen, it selects the item, closes the list, and displays the tooltip until you click somewhere else on the screen. I kind of think maybe there should be a separate button for showing the tooltip vs selecting the item. How would I achieve this?
Martin
Telerik team
 answered on 09 Feb 2024
1 answer
22 views

i have two html (main.html and submission.html), but when i tried to open a kendo window to window.parent (main.html) and create a kendo dropdownlist from the kendo window and pass datasource to the dropdownlist, but it will have error

main.html

<div><iframe id="iframeContent" src="submission.html"></iframe></div>

 

submission.html

<script type="text/template">

window.parent.$("<div>").kendoWindow().content("<div id="dropdownlist"></div>").center().open();

window.parent.$("#dropdownlist").kendoDropDownList({

dataSource: [ { id: "1", name: "123" } ],

dataTextField: "name",

dataValueField: "id",

optionLabel: "-- Please Select --"

})

</script>

Martin
Telerik team
 answered on 01 Nov 2023
1 answer
144 views

Hi,

I am currently attempting to upgrade the Kendo UI from 2022.2.510 to 2023.2.829 and need some assistance figuring out which .css files and .js files are the closest match to what I have for 2022.2.510. Wow it's different....seems like most of the css and javascript libraries have been reorganized.

    <link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="Kendo/2023.2.829/styles/kendo.common.min.css" />
    <link rel="stylesheet" href="Kendo/2023.2.829/styles/kendo.bootstrap.min.css" />
    <link rel="stylesheet" href="Kendo/2023.2.829/styles/kendo.bootstrap.mobile.min.css" />
    <link rel="stylesheet" href="FontAwesome/font-awesome-4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="styles/jquery_1.12.0-rc2/jquery-ui.min.css" />

    <!-- JAVASCRIPT -->
    <script type="text/javascript" src="Kendo/2023.2.829/js/jquery.min.js"></script>
    <script type="text/javascript" src="Kendo/2023.2.829/js/jszip.min.js"></script>
    <script type="text/javascript" src="Kendo/2023.2.829/js/kendo.all.min.js"></script>
    <script type="text/javascript" src="Kendo/2023.2.829/js/kendo.timezones.min.js"></script>
    <script type="text/javascript" src="scripts/jquery-ui.min.js"></script>
    <script type="text/javascript" src="scripts/populateTable.js"></script>
    <script type="text/javascript" src="scripts/interimDataRecs.js"></script>
    <script type="text/javascript" src="scripts/payrollDataRecs.js"></script>

I am fairly new at working with the Kendo UI -- I may just need to be pointed to documentation or a README that maps the old files to the new(?). I am not using anything fancy...these are pretty much the default controls.

So far I have not attempted to swap out ANYTHING.... I don't even know where to begin.. I am however, starting to do this shortly.  Yikes! 

FYI: I am using the following controls:

  • kendoDropDownList
  • kendoButton
  • kendoGrid (detailInit -- using the hiarchical stuff).
  • kendoSwitch
  • kendoNotification
  • kendoToolTip

Be curious if you all have a recommend approach or stratedgy to upgrading Kendo UI for jQuery libraries?

I'd also like to know the best approach to minifying the Kendo folders?

The Kendo stuff is stashed in the wwwroot (I did not design this structurer ... but I am stuck with it.):

Thanks for your help and patience  ^__^

George

George
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 11 Oct 2023
1 answer
75 views
   

Hello, the following code works like a charm:


var arr = [
      {text:"Option 11",value:"Value 11"},
      {text:"Option 22",value:"Value 22"}
     ];
    

    arr.push({text:"Option 33",value:"Value 33"});

    var datasource = new kendo.data.DataSource({
      data: arr
    });
    datasource.read();

    jQuery("#operation").data("kendoDropDownList").setDataSource(datasource);

However if I try this:


var arr = [
      {text:"Option 11",value:"Value 11"},
      {text:"Option 22",value:"Value 22"}
     ];

for(i=0;i<operators.length;i++) {
      
      var singleElement = {
        text:operators[i],
        value:operators[i]
      };

      arr.push(singleElement);
}

var datasource = new kendo.data.DataSource({
      data: arr
    });

datasource.read();

jQuery("#operation").data("kendoDropDownList").setDataSource(datasource);

I get [object Object] where I should have the elements
of operators as values and text on the dropdownlist.

If I try this:


var arr = [
      {text:"Option 11",value:"Value 11"},
      {text:"Option 22",value:"Value 22"}
     ];

for(i=0;i<operators.length;i++) {
      
      var singleElement = "{text:\""+operators[i]+",value:\""+operators[i]+"\"}";


      arr.push(singleElement);
}

var datasource = new kendo.data.DataSource({
      data: arr
    });

datasource.read();

jQuery("#operation").data("kendoDropDownList").setDataSource(datasource);

I get "undefined" where I should have the elements
of operators as values and text on the dropdownlist.

Any idea on how can get the values from "operators" into the datasource and show up on the dropdownlist ? 

Thanks,

Rafael

 

Rafael
Top achievements
Rank 1
Iron
 answered on 20 Sep 2023
1 answer
86 views

I have a kendo dropdownlist with virtualization and a local array of objects used as the data source. I need to replace the datasource based on selections the user makes elsewhere on the page. The problem I'm having is that since it uses virtualization, I don't know when the datasource has finished being updated with setDataSource(newDataSource) and as such, sometimes when I try to set the new value, the new value isn't there. I don't want to use setTimeout because that is bad practice as it assumes it will take a certain amount of time to complete. The cascade event seems to only work after changing the value, not the dataSource. Is there a way to do something like this reliably: 

var newDataSourcce = getDataSource();
myDropdownList.setDataSource(newDataSource);
myDropdownList.value(100);
I can't make a dojo because the JSON object used as a datasource is too large and using a smaller array doesn't trigger the issue. Also note the getDataSource() is a function that filters the JSON object based on the other selections a user made (e.g. department: food, type: fruit, color: red; limits the list to red fruits).
Martin
Telerik team
 answered on 25 Aug 2023
1 answer
141 views

After Implmenting the Content Security Policy (CSP) in our application, various Kendo controls have stopped working. The CSP, blocks execution of inline scripts and since the Kendo controls are creating scripts while they render, CSP finds it as a threat and hence blocks its execution.

Below is a snapshot of the browser console error. All of the 5 errors are being thrown by kendo Controls.

When the Kendo Control, such as a grid, is rendered, a script tag is generated. Please check the below screenshot for reference.

Here, we have a grid, divIFAResults, when it is rendered on the screen, a script tag with Kendo.syncReady() is generated. The Kendo Grid relies on this script for its smooth execution, but our CSP blocks this script, inturn making the control unusable.

We have added 'unsafe-eval' as per the telerik docs for CSP. We are using the Kendo files hosted in our own project, not from CDN.

Georgi Denchev
Telerik team
 answered on 25 Aug 2023
1 answer
123 views
I'm using the kendo editor tool for a rich text editor, and I want to change the default font family. No matter what I do (I've tried accessing the HTML element by jQuery and DOM selectors and change its value), the selected font stays "inherited font" option, what should I do? (Same goes for "inherited size", for the font size)
Zornitsa
Telerik team
 answered on 21 Aug 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?