Telerik Forums
Kendo UI for jQuery Forum
5 answers
191 views

 

Hello,

I'm trying to create a grid that will be reused very often

 

<div>--other content--</div>
<kendo-grid [data]="gridData"></kendo-grid>

 

I tried to encapsulate this  into my own <custom-grid> component

 

<custom-grid [gridData]="myData"></custom-grid>

 

I'm aware that in the jquery version i could use grid-options to give my encapsulated grid all the info i needed.

Was this removed in the angular version?

Thank you.

Dimiter Topalov
Telerik team
 answered on 21 Apr 2017
2 answers
289 views

Hello Team,

I am using bar chart in my app, At some instances when I have large  value my label is hiding within the chart.

I tried giving 100 % width to the parent div and 99% to the div on which I am building the chart but it doesn't always works because value can be of any length(e.g it works if i have 194, but doesn't work if I have 1987643).

I tried giving overflow:visible to <svg> and other parent div but no success.

Check the snapshot for the reference.

 

 

Preslav
Telerik team
 answered on 21 Apr 2017
10 answers
427 views

I'm creating a custom Editor for TEXT AREA for my Kendo Grid. The grid will have in-line editing.

I was wondering if I could reuse the same editor for other columns as well ?

Code:

<%@ Control Language="C#" %> <textarea id="Description" name="Description" class="k-textbox"></textarea>

 

For example the above code can bind to column Description but what if I want to use it for another column such as Address ?

How to do it ?

Boyan Dimitrov
Telerik team
 answered on 21 Apr 2017
1 answer
119 views

Hi all, 

I recently updated to kendo UI 2017, and now I am having an issue with text showing behind the kendo grid paging navigation. I can do a css hack to hide the content and just show the glyphicons. But that is just a css hack.

Please take a look at the attach file and let me know what you think. 

Thanks. 

 

Tsvetina
Telerik team
 answered on 21 Apr 2017
1 answer
125 views

first scenario: pageSize:5
1. my grid is displaying 5 rows. on the right side of grid footer it says 1-3 of 3 items. how??
2. actual result have seven data items still grid doesn't allow me to go to the next page.

second scenario: pageSize:2
1. in the right side of grid footer it says 1-2 of 3 items, as soon as I clicked on second page it says 3-4 of 7 items.

i really do not understand why grid is behaving so weird. what am I doing wrong?
i have attached png files for both scenario and as well as in what form my data is coming. please take a look at those pictures.
the below one is my grid. please let me know what is wrong i'm doing.

references that I have follow to create this grid is http://www.telerik.com/forums/grid-support-for-data-in-array-form-instead-of-object-form#KyFQE9yl006Mm_iV0QM8fw

http://jsbin.com/utaquf/9/edit?html,js,output

001.$.ajax({
002.        type: "GET",
003.        url: "/Actionables/SearchSubmissions/",
004.        data: {
005.            filters: param,
006.            moduleToSearch: moduleID,
007.            moduleItemToSearch: moduleItemID,
008.        },
009.        success: function (result) {
010.            var defer = $.Deferred();
011.            function confirmation(result) {
012.                if (result.length > 1) {
013.                    $('#field' + questionID).append('<div id=dialog></div>');
014.                    $("#dialog").append('<div id=grid></div>');
015.                    $("#dialog").kendoDialog({
016.                        modal: true,
017.                        visible: false,
018.                        draggable: true,
019.                        closable: false,
020.                        title: "Please Select One Submission",
021.                        maxWidth: 500,
022.                        //maxHeight:300,
023.                        animation: {
024.                            open: {
025.                                effects: "slideIn:down fadeIn",
026.                                duration: 500
027.                            },
028.                            close: {
029.                                effects: "slide:up fadeOut",
030.                                duration: 500
031.                            }
032.                        },
033.                        actions: [
034.                            { text: 'OK', primary: true, action: onOK }
035.                        ]
036.                    });
037.                    $("#grid").kendoGrid({
038.                        dataSource: {
039.                           data: result,
040.                            schema: {
041.                                data: function (result) {
042.                          return $.map(result, function (item) {
043.                           return $.map(item, function (innerData) {
044.                            for (var i = 0; i < displayFields.length; i++){
045.                            if (displayFields[i] == innerData.FieldIDString)
046.                            {
047.                               return {
048.                              EntryGroupID: innerData.EntryGroupID,
049.                              FieldTextString : innerData.FieldTextString,
050.                              EntryValue: innerData.EntryValue
051.                                     }
052.                             }
053.                                   }
054.                               });
055.                           });
056.                        }
057.                     },
058.                     pageSize: 2,
059.                     group: { field: "EntryGroupID" }                         
060.                       },
061.                        filterable: {
062.                            mode: "row"
063.                        },
064.                        pageable: {
065.                            refresh: true,
066.                        },
067.                        noRecords: {
068.                            template: "No records to display"
069.                        },
070.                        groupable:false,
071.                        //scrollable: true,
072.                        selectable: true,
073.                        columns: [{
074.                            field: "EntryGroupID",
075.                            title: "Submissions",
076.                            filterable: {
077.                                cell: {
078.                                    operator: "contains"
079.                                }
080.                            }
081.                        }, {
082.                            field: "FieldTextString",
083.                            title: "Questions",
084.                            filterable: {
085.                                cell: {
086.                                    operator: "contains"
087.                                }
088.                            }
089.                        }, {
090.                            field: "EntryValue",
091.                            title: "Answers",
092.                            filterable: {
093.                                cell: {
094.                                    operator: "contains"
095.                                }
096.                            }
097.                        }]
098.                    });
099.                    var wnd = $("#dialog").data("kendoDialog");
100.                    wnd.wrapper.find('.k-dialog-title').css('background', CIMSFields.backgroundColour).css('color', IMSFields.textColour).css('width','100%').css('text-align','center');
101.                    wnd.open().center(true);
102. 
103.                    function onOK(e) {
104.                        var data = [];
105.                        var grid = $("#grid").data("kendoGrid");
106.                        var selectedItem = grid.dataItem(grid.select());
107.                        if (selectedItem != null) {
108.                            $.map(result, function (item) {
109.                     if (selectedItem.EntryGroupID == item[0].EntryGroupID) {
110.                                    data.push(item);
111.                                    defer.resolve(data);
112.                                }
113.                            });
114.                        }
115.                        else {
116.                            defer.resolve(data);
117.                        }
118.                        wnd.close();
119.                    }
120.                }
121.                else{
122.                    defer.resolve(result);
123.                }
124. 
125.                return defer.promise();
126. 
127.            }
Preslav
Telerik team
 answered on 21 Apr 2017
7 answers
1.5K+ views

Hi Guys,

 

I'm wondering if would be possible to add a title/header to excel exported file from grid.

Something similar to how the export to pdf shows a nice title on top of page.

Is there any way to accomplish this?

 

Cheers!

 

Alex Hajigeorgieva
Telerik team
 answered on 21 Apr 2017
5 answers
653 views

I have multiple text boxes where users can enter search parameters to query an Oracle database to return data to a grid. I ham having a hard time validating these text boxes as a group. By group I mean that I want to make sure that at least 1 text box has data in it. If I dont, the user could potentially bring back 16 million records. This obviously will take a while and I cant have that. I have tried about 5 different ways to do this. I can validate each field but i cant move on because each field is requiring something. Again, I want to check and make sure that at least one of the 9 text boxes has something in it. I apologize the mess of the validation code. has mixes of a few different ways I was trying.  

The attached photo shows that my current way of thinking is wrong.  Since there is a value in one text box, the rest of the validations should technically be true and it should move on to the next step - populating a data grid.

code body:

    <div class="col-lg-12 col-md-12">
    <div class="panel panel-primary" style="margin-top:5px;" id="CustHistSearchPanel">
        <div class="panel-heading">
            <h3 class="panel-title"  id="collapseAll" data-toggle="collapse" data-target="#collapsePanelCustHist" href="#collapsePanelCustHist">
                Customer History
            </h3>
        </div>
        <div id="collapsePanelCustHist" class="panel-collapse collapse in">
            <div class="panel-body" id="CustHistSearchPanelBody">
                <form id="CustHistForm"  data-role="validator" novalidate="novalidate">
                    <div class="col-lg-12 col-md-12">
                        <div class="col-lg-3 col-md-3">
                            <div class="form-group">
                                <label for="acctNum">Account Number</label>
                                @Html.TextBox("acctnum", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "acctNum"
                            })
                                <label for="premiseNum">Premise Number</label>
                                @Html.TextBox("premisenumber", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "premiseNum"
                            })
                                <label for="timeFrame" class="control-label">Timeframe</label><br />
                                @Html.RadioButton("timeframe", "1", new { @type = "radio", @class = "formElements", @id = "ALL" }) All&nbsp;&nbsp;
                                @Html.RadioButton("timeframe", "2", new { @type = "radio", @class = "formElements", @id = "LAST5" }) Last 5 Years&nbsp;&nbsp;
                                @Html.RadioButton("timeframe", "3", new { @type = "radio", @class = "formElements", @id = "YTD" }) YTD&nbsp;&nbsp;
                                @Html.RadioButton("timeframe", "4", new { @type = "radio", @class = "formElements", @id = "MTD", @checked = "checked" }) MTD&nbsp;&nbsp;
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3">
                            <div class="form-group">
                                <label for="busLastName">Bus/Last Name</label>
                                @Html.TextBox("buslastname", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "busLastName"
                            })
                                <label for="firstName">First Name</label>
                                @Html.TextBox("firstname", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "firstName"
                            })
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3">
                            <div class="form-group">
                                <label for="houseNum">House Num</label>
                                @Html.TextBox("housenum", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "houseNum"
                            })
                                <label for="street">Street</label>
                                @Html.TextBox("street", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "street"
                            })
                                <label for="cityState">City, State</label>
                                @Html.TextBox("citystate", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "cityState"
                            })
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3">
                            <div class="form-group">
                                <label for="homePhone1">Home Phone</label>
                                @Html.TextBox("homephone", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "homePhone",
                                @type = "text"
                            })
                                <label for="contactPhone">Contact Phone</label>
                                @Html.TextBox("contactphone", "",
                            new
                            {
                                @class = "form-control formElements",
                                @id = "contactPhone"
                            })
                            </div>
                        </div>
                    </div>
                </form>

 

Validation code:

$(function () {
        var formContainer = $("#CustHistForm");
        kendo.init(formContainer);
        formContainer.kendoValidator(
            {
                rules:
                    {
                        customRule: function (input)
                            {
                            var isValid = true;
                            var count = 0;
                                $('input[type="text"]').each(function ()
                                    {
                                        if ($.trim($(this).val()) == '')
                                            {
                                                isValid = false;
                                                $(this).css(
                                                    {
                                                        "border": "1px solid red",
                                                        "background": "#FFCECE"
                                                    });
                                                count = count + 0;
                                            }
                                        else
                                        {
                                            count = count + 1
                                            isValid = false;
                                                $(this).css(
                                                    {
                                                        "border": "",
                                                        "background": ""
                                                    });
                                            }       
                                    })
                                {
                                    if (count > 0) {
                                        isValid = true;
                                    }
                                    isValid = input.val().match(/^\S+$/) != null;
                                    console.log("[name2=" + input.attr("name") + ']  ' + isValid + '   ' + count);
                                    }
                                return isValid;
                                console.log(isValid);
                            }
                    },
                        messages:
                            {
                                customRule: "At least one field must contain data."
                            }
            }).data("kendoValidator");
    });

Konstantin Dikov
Telerik team
 answered on 21 Apr 2017
6 answers
979 views

 Hello

I'm having some bad hours fiddling around with Kendo UI Upload to make what I want. Initially I wanted to restrict specific file types by "validation" parameter AND set the parameter "maxFileSize" depending on file type. This all with the autoupload feature (selecting one or more files). Something like:
.jpg, .png, .gif -> max 1 MB
.mp3 > max 5 MB
.mp4 -> max 10 MB

The world would have been perfect that way. As I was told: Both configuration parameter at the same time are not supported.

Just setting one parameter seems to work great and the Upload Widget does only upload the ones passing the set options. 

Ok, one step back and doing own checks based on e.files while trying to use e.preventDefault(); in select event. Oh great, it prevents ALL files to be uploaded even the valid ones! Why can the Upload Widget itself differ between valid and invalid ones (in order to upload only the valid ones) while I - as programmer - have no chance to define which files are ready to upload and which are not?

Ok, one step back: I tried to remove invalid files from e.files in select event. Guess what: it doesn't matter what I do in here! The upload event has its own list and ignores any operation I have done inside e.files in select event. 

Ok, one step back: where to?

All Kendo UI Widgets have their pros and cons. I'm using many and in some cases I had to and could find a workaround for what I wanted. But the Upload Widget is by far the worst, inconsistent and inflexible Widget in the list! 

Tayger
Top achievements
Rank 1
Iron
 answered on 21 Apr 2017
3 answers
61 views

Hi,

We are using Kendo UI Menu in our SPA solution and we are getting some strange behavior from the Menu component. The menu is configured to expand and show all items when the mouse-over event is fired.The items are added based on an API call and contains all the projects users of the solution has access to. If a user changes project and then click on the menu before the menu is able to expand, and while the menu is still selected from the previous project change, the text from all items in the menu is appended and shown as the selected item.

This only happens in IE11 and Edge, if I try to set IE11 to behave as IE10 the issue goes away. Chrome works just fine. If I run this in the dev env. I am able to get the same "chain of events" in Chrome if I just browser sync and use IE for interaction. 

When debugging I can see that the select event for the menu is supplied with an  "e" object where the "e.item.textContent" property is set to the text from all the items in the datasource.

Have you encountered this before?

Ivan Danchev
Telerik team
 answered on 21 Apr 2017
2 answers
362 views

The column headers are displaying but no data from the JSON file I used in my source.

<div id="example">
           <div id="grid"></div>
           <script>
               $(document).ready(function() {
                   $("#grid").kendoGrid({
                       dataSource: {
                           type: "json",
                           serverPaging: true,
                           serverSorting: true,
                           pageSize: 100,
                           transport: {
                               read: "http://localhost/Temp/examples/grid/data.json",
                           }
                       },
                       height: 543,
                       scrollable: {
                           virtual: true
                       },
                       sortable: true,
                       columns: [
                           { field: "FirstName", title: "First Name", width: 100 },
                           { field: "LastName", title: "Last Name", width: 100},
                           { field: "Email", title: "Email", width: 50 },
                           { field: "Desk", title: "Desk", width: 50 },
                           { field: "Mobile", title: "Mobile", width: 50 },
                           { field: "Location", title: "Location", width: 110 }
                       ]
                   });
               });
           </script>
           <style>
 
               /*horizontal Grid scrollbar should appear if the browser window is shrinked too much*/
               #grid table
               {
                   min-width: 1190px;
               }
 
           </style>
       </div>

 

Maybe the JSON fine isn't properly formatted?

 

Stefan
Telerik team
 answered on 21 Apr 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?