Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.1K+ views

I have a Autocomplete kendo control. I am selecting some values by doing a filtering after selecting 5 items as shown in the attached image. I am able to retrieve value after individual selection. But I want to get dataValueField for the all the selected items of Autocomplete control in change event. Please find the below code. Kindly suggest in this

$("#Products").kendoAutoComplete({
                        dataSource: result,
                        dataTextField: "TagName",
                        dataValueField:"TagID",
                        filter: "startswith",
                        placeholder: "Select Product...",
                        separator: ", ",
                        select: function (e) {
                            if (e.dataItem) {
                                var dataItem = e.dataItem;
                                alert(dataItem.TagID);//Returns dataValueField value for individual selected item
                                alert(dataItem.TagName);//Returns dataTextField value for individual selected item
                            }
                            if (e.item)
                            {
                                //var dataItem = e.dataItem;
                                var item = e.item;
                                var text = item.text();  //Returns dataTextField value for individual selected item                              
                            }
                        },
                        change: function (e) {
                            alert($("#Products").data("kendoAutoComplete").value());//Returns dataTextField value for multiple selected items
                            var s=$("#Products").data("kendoAutoComplete").value(); //Returns dataTextField value for multiple selected items
                           //Need to get dataValueField for multiple selected items
                        }
                    });

 

Stoyan
Telerik team
 answered on 31 Mar 2021
0 answers
364 views

On my page i have 2 tabs . First tab contains item with details . On page load details open perfectly . on First tab click , i get the data again .Now details does not open . But on second click on First tab , we get the data again and now i am able to expand the details data again . On each alternate click on the First tab , i am able to get expand details data again

Note : Details expands in debugger mode but only once

 function LoadCustomGrid(CurrentDivID) {
                
            ds = new kendo.data.DataSource({
                type: "odata",
                transport: {
                    read: {
                        url: "../Handler/OrderHandler.ashx?Action=GetETAMissedOrders",
                        type: "POST",                        
                        data: { 'MerchantId': '<%=gMerchantID%>'},
                        complete: function (jqXHR, textStatus) {
                            kendo.ui.progress($("[Id$=" + CurrentDivID + "]"), false);
                            if (textStatus == 'parsererror') {
                                ShowMessage('E', jqXHR.responseText);
                            }
                        }
                    },
                    parameterMap: function (options, operation) {
                        if (operation !== "read" && options.models) {
                            return {
                                models: kendo.stringify(options.models)
                            };
                        }
                        else {
                            return JSON.stringify(options);
                        }
                    }
                },
                schema: {
                    model: {
                        fields: {
                            Age: { type: "string", editable: false },
                            OrderDate: { type: "date", editable: false },
                            OrderID: { type: "string" },
                            ETA: { type: "date", editable: false },
                            PaymentType: { type: "string", editable: false },
                            DeliveryMode: { type: "string" },
                            OrderRefUrl: { type: "string" }
                        }
                    }

                },
                error: function (e) {
                    ShowMessage("E", "Request cannot be served at this time.")
                },
                page: 1,
                pageSize: 20,
                serverPaging: false,
                serverFiltering: false,
                serverSorting: false
            });
            var CustomizedColumns = [];
            if (CurrentDivID == 'divETAMissedGrid') {
                CustomizedColumns = [
                    {
                        field: "Box", title: "<input id='checkAll', type='checkbox', onclick='checkall()' />", width: "5%", filterable: false,
                        template: "<input type=\"checkbox\" id='chk_\#=OrderID#\'  onclick=''/>", menu: false, headerAttributes: { style: "background: none;" }
                    },
                        
                        {
                            field: "OrderID",
                            title: "Order Id",
                            width: "8%",
                            template: '<a target=_blank id=ref_\#=OrderID#\  href=\#=OrderRefUrl#\> \#=OrderID#\ </br> </a> ',
                            filterable: {
                                extra: false, operators: { // redefine the string operators
                                    string: {
                                        eq: "Is Equal To"
                                    }
                                }
                            }
                        },
                         {
                             field: "OrderDate",
                             title: "Order Time",
                             width: "10%",
                             template: "#if(kendo.toString(OrderDate,'dd-MMM-yyyy') =='01-Jan-0001'){#  #}else{# #= kendo.toString(kendo.parseDate(OrderDate), 'd-MMM-yyyy h:mm:ss tt')# #}#",
                             filterable: {
                                 extra: true, operators: { // redefine the string operators
                                     date: {
                                         lte: "Is Befor or Equal To",
                                         gte: "Is After or Equal to"
                                     }
                                 }
                             }
                    },
                         {
                            field: "Age",
                            title: "Order Age",
                            filterable: false,
                            width: "6%"
                        },
                         {
                             field: "ETA",
                             title: "ETA Time",
                             width: "10%",
                             template: "#if(kendo.toString(ETA,'dd-MMM-yyyy') =='01-Jan-0001'){#  #}else{# #= kendo.toString(kendo.parseDate(ETA), 'd-MMM-yyyy h:mm:ss tt')# #}#",
                             filterable: {
                                 extra: true, operators: { // redefine the string operators
                                     date: {
                                         lte: "Is Befor or Equal To",
                                         gte: "Is After or Equal to"
                                     }
                                 }
                             }
                    },
                         {
                            field: "PaymentType",
                            title: "Payment Type",
                            filterable: false,
                            width: "8%"
                    },
                         {
                            field: "DeliveryMode",
                            title: "Delivery Mode",
                            filterable: false,
                            width: "8%"
                        },
              {
                  field: "", title: "Action", width: "8%",
                  template: "<input type=\"button\" class='button_small greyishBtn' value='Update' id='\#=OrderID#\' onclick='UpdateOrderETA(this)'/>", menu: false, headerAttributes: { style: "background: none;" }
              }
                ];

            }
            var datagrid = $("[Id$=" + CurrentDivID + "]").kendoGrid({
                dataSource: ds,
                sortable: false,
                navigatable: true,
                filterable: true,
                columns: eval(CustomizedColumns),
                sorting: false,
                pageable: {
                    pageSizes: [20, 40, 60,80, 100]
                },
                dataBound: function () {
                    $(".tipsyrev").tipsy({ gravity: 's', fade: true, html: 'true' });
                    var grid = $("[Id$=" + CurrentDivID + "]").data("kendoGrid");
                    var count = grid.dataSource.total();
                    if (count == 0) {
                        $(".k-grid table").addClass("activity_datatable");
                    } else {

                        $("[Id$=" + CurrentDivID + "]").show(500);
                        $(".k-grid table").addClass("activity_datatable");
                    }
                     $("tr.k-alt").removeClass("k-alt");
                },
                detailInit: detailInit
            });
            return false;
        }

        function detailInit(e) {
        var schemaJson = [];
            var columnJson = new Array();
            var dsdetail = eval(e.data.ETAmissedItems);
            e.detailCell.html("");

            columnJson.push({ field: "RetransactionId", title: "RetransactionId" , hidden: true });
            columnJson.push({ field: "RedetailsId", title: "RedetailsId" , hidden: true });
            columnJson.push({ field: "Sku", title: "Sku" });
            columnJson.push({ field: "VariantSku", title: "Variant Sku" });
            columnJson.push({ field: "Qty", title: "Quantity" , width: "7%" });
            columnJson.push({ field: "Price", title: "Price" });
            columnJson.push({ field: "ItemETA", title: "ETA Time" ,template: "#if(kendo.toString(ItemETA,'dd-MMM-yyyy') =='01-Jan-0001'){#  #}else{# #= kendo.toString(kendo.parseDate(ItemETA), 'd-MMM-yyyy h:mm:ss tt')# #}#" });
            columnJson.push({
                field: "", title: "Action", width: "10%",
                template: "<input type=\"button\" class='button_small greyishBtn' value='Update'  onclick='UpdateOrderItemETA(\#=RetransactionId#\ , \#=RedetailsId#\ ,  \"#=Sku#\" ,  \"#=VariantSku#\")'/>", menu: false, headerAttributes: { style: "background: none;" }
            });

        $("<div/>").appendTo(e.detailCell).kendoGrid({
            dataSource: { data: dsdetail },
            scrollable: true,
            sortable: true,
            resizable: true,
            columns: columnJson,
            selectable: false,
            sorting: false,
            reorderable: true,
            filterable: {
                extra: false
            },
        });
        }

Saurav
Top achievements
Rank 1
 asked on 31 Mar 2021
8 answers
245 views

I have a project that is using version 2019.1.220 and I have found some issues with them. However when I try to reproduce them on the dojo they are not reproducible.

For example for the TreeView the loading text is not fully displayed. I investigate a little a saw that my release version generates "<div class="k-icon...">Loading...<div>" while the dojo with the same version generates "<div class="k-icon..."></div>Loading...". Why does the dojo uses a different version then the released one?

Henry
Top achievements
Rank 2
 answered on 31 Mar 2021
6 answers
107 views

I was wondering whether the resources are intended only for people/time based resources or if it is ok to use for material/quantity type resources eg. cement, wire etc.

It looks like I can customize the unit number format to show kg, metres

Ivan Danchev
Telerik team
 answered on 31 Mar 2021
3 answers
336 views

How can I remove the overlay on the pie chart. If you look at the demos you can see that the colors are the same as the ones defined, but when you try to edit it in a dojo the colors are not the ones defined. they have an overlay on top of them that contains a defined color of "url(https://runner.telerik.io/result#kdef1)".

Why does the dojo look different that the demo? How can the top overlay be removed?

Nikolay
Telerik team
 answered on 31 Mar 2021
3 answers
264 views

When using a custom optionLabelTemplate and valueTemplate with Font Awesome dual tone icons it seems we need to set the display css class to inline-flex to keep the icon from separating (Kendo UI v2020.3.1021 in Chrome v88.0.4324.104).

$("#dropDownList").kendoDropDownList({
  optionLabel: "Select One"
  , template: "<i class=\"#=icon# mr-1\" style=\"font-size: 25px\"></i>#=name#"
  , optionLabelTemplate: "<i class=\"fad fa-hard-hat mr-1\" style=\"display: inline-flex\"></i>Select One"
  , valueTemplate: "<i class=\"#=icon# mr-1\" style=\"display: inline-flex\"></i>#=name#"
  ...
});
Misho
Telerik team
 answered on 31 Mar 2021
2 answers
2.0K+ views

 

 

I am trying to export data from my grid to Excel. 

For my button I am using the following code, as I don't have the buttons in a toolbar.

 

<span>
<button id="btnExport">Export to Excel</button>
<script> $("#btnExport").kendoButton({
click: function() { 
$("#grid").data("kendoGrid").saveAsExcel() 

})</script>
</span>

and on the grid I have the following (truncated)

// Grid
grid = $("#grid").kendoGrid( {
      excel:{
          fileName: "PC Inventory All.xlsx",
          filterable:true,
          allPages:false
        },

The error message that I receive is "uncaught Error: JSZip not found."

I have included this file, or at least I thought that I have. I am running Xpages (JSP in essence) and my theme includes the following resources:

 

 <resource>
 <content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/jquery.min.js</href>
</resource>

 <resource>
 <content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/jszip.min.js</href>
</resource>

<resource>
 <content-type>application/x-javascript</content-type>
 <href>/.ibmxspres/domino/KendoUI/js/kendo.all.min.js</href>
</resource>

 <resource>
 <content-type>text/css</content-type>
<href>/.ibmxspres/domino/KendoUI/styles/kendo.common.min.css</href>
</resource>

 <resource>
 <content-type>text/css</content-type>
 <href>/.ibmxspres/domino/KendoUI/styles/kendo.blueopal.min.css</href>
</resource>

I see all of these resources in the Sources tab of Chrome Dev tools, but I also see several multiple defines - one of which seems to be doing something with a dojo library. 

I am at a loss, any help would be much appreciated.

 

Tarek
Top achievements
Rank 1
 answered on 31 Mar 2021
2 answers
101 views

Hi

 

I use an master detail Grid..I need to change detail data table text color conditionnaly to master row ?

Could you help me

Thanks

Anton Mironov
Telerik team
 answered on 30 Mar 2021
1 answer
114 views

Hi

 

I have found this sample in NET version https://demos.telerik.com/aspnet-mvc/grid/editing-custom-validation#source-code

 Do you have same for AngularJS or Jquery ?

Regards

 

 

Mihaela
Telerik team
 answered on 30 Mar 2021
1 answer
234 views

I have a grid which looks like this:

@(Html.Kendo().Grid()
    .Columns(columns =>
    {
        foreach (var fieldId in listOfFieldIds)
        {
            columns.Bound(o => o.DictionaryOfFieldIdsToValues[id].Value);
        }
    }
    .DataSource(dataSource =>
    {
        dataSource.SignalR()
            .Filter(filter =>
            {
                filter.Add(o => o.DictionaryOfFieldIdsToValues["MyId123"].Value).Contains("hello world");
            });
        })
    });

 

Programmatically setting the filter is not working as expected:

1) the column which corresponds to MyId123 does not get the filter in its header menu

2) on inspecting the filter in parameterMap, the filter has been applied as a filter collection, like so

{logic: "and", filters: Array(1)}
    filters: Array(1)
    0:
        filters: Array(1)
        0: {field: "DictionaryOfFieldIdsToValues["MyId123"].Value", operator: "contains", value: "hello world"}
        length: 1
    logic: "and"
    length: 1

When a user filters the column themselves it works as expected (parameterMap shows this)

{logic: "and", filters: Array(1)}
    0: {field: "DictionaryOfFieldIdsToValues["MyId123"].Value", operator: "contains", value: "hello world"}
    length: 1
    logic: "and"

 

Tsvetomir
Telerik team
 answered on 30 Mar 2021
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?