Telerik Forums
Kendo UI for jQuery Forum
1 answer
12 views
 

I am trying to create a multifilter from enum data type column using the ItemTemplate. But ItemTemplate Javascript function is not being called and data is not being shown in combobox. Please can you give me a help. Here is the code

Enum Records

public enum EmpTypes
{
    [Display(Name = "Service")]
    Service = 0,
    [Display(Name = "Sales")]
    Sales = 1,
    [Display(Name = "Purchase")]
    Purchase = 2,
    [Display(Name = "Office")]
    Office = 3
}

Kendo Grid

columns.Bound(c => c.EmpTypes).Title("Type")
        .Filterable(filterable => filterable
            .Multi(true)
            .UI(“”).DataSource(s=>s.Read(r=>r.Action(“GetEmpTypes”,”Report”)))
            .ItemTemplate(“typetemplate”));
<script>
 function typetemplate(e)
{
  alert('Test');
}

</script>
Action Method in MVC controller

Public ActionResult GetEmpTypes()
{
 List<EmpType> emptypes = new List<EmpType>();
emptypes.Add(EmpType.Sales)
emptypes.Add(EmpType.Report)
return Json(emptypes,JsonRequestBehavior.AllowGet);
}


 

Mihaela
Telerik team
 answered on 13 Mar 2024
6 answers
92 views

Hello,

I currently have multiple comboBoxes in a modal view, once everythig is opened up there is a single x above the comboBox (photo 1) but if i leave the page and come back a new x will appear over the comboBoxes (photo2). 

the code for the html portion is 

<div data-role="view" data-title="New Simulation" data-layout="back" data-model="app.newSim" data-before-show="app.newSim.beforeShow">
     <a href="#NewSimModal" data-rel="modalview" data-role="button">Open Modal</a>

</div>

 

<div data-role="modalview" id="NewSimModal" style="width: 75%; height: 70%;  border-style:double;" data-modal="false">
<input id="Manufacturer" />
<input id="ProductFam" />
  <input id="CCT" />
  <input id="CRI" />
  <input id="PartNumber" />
  <a data-role="button" data-click="app.newSim.addLED">add LED</a>
</div>

 

And a piece of the javascript portion is 

$("#CCT").kendoComboBox({
    dataTextField: "CCT",
    dataValueField: "CCT",
    dataSource: app.CCTData,
    index: 0
});

$("#CRI").kendoComboBox({
    dataTextField: "CRI",
    dataValueField: "CRI",
    dataSource: app.CRIData,
    index: 0
});

$("#PartNumber").kendoComboBox({
    dataTextField: "LEDPartNumber",
    dataValueField: "LEDPartNumber",
    //dataSource: app.data
});

 

Naimesh
Top achievements
Rank 1
Iron
 answered on 20 Jun 2023
1 answer
51 views

As subject says, we load the combobox in a kendo window by demand.

Hence the combobox and window are not visible by default.

I wrote a short function to preselect either the entry with ID -1 if it exists - else I want the first entry to be displayed.

My problem is the dynamic loading of all that - my commands are executed in the databound event of the combobox - but it seems not to work as expected .. when I manually enter the needed command AFTER that kendo window with the combobox is displayed it works to a 'T' but not during regular execution ..

Can you give me some hints ?

 


                 onComboBoxDataBound: function (evt) {
                    var widget = evt.sender;
                    if (this.dataSource.total() > 0) {
                        // delete preselection then try to select entry with id -1
                        $('#modComboBox').data('kendoComboBox').input.select();
                        $('#modComboBox').data('kendoComboBox').input.val('');
                        $('#modComboBox').data('kendoComboBox').select(function (data) {
                            return data.id == -1;
                        });
                        // no selection then select first entry
                        if (widget.select() === -1) { // hint I found in stackoverflow
                            $('#modComboBox').data('kendoComboBox').select(0);
                        }
                    }
                },

I tried "waiting" for the kendo window to be displayed - but that waiting seems to interfere with normal code execution and prevents the "popup display" from being executed so the kendo window content is displayed behind other stuff 
Sven
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 18 Apr 2023
0 answers
43 views

I am looking for a help where I need to recreate the options for column filter values when the data on left hand side filter changes?

I have a drop down list country on left hand side and when ever user select the country the column(region), filter (custom filter, based on column on the grid) all the checkboxes for the custom filter should reflect the region as per the country selected.

Vaibhav
Top achievements
Rank 1
Iron
 asked on 09 Apr 2023
0 answers
64 views

We are currently trying to upgrade from 2019.3.917 to 2023.1.117

Some code that worked fine in the old version is failing in the new with error in kendo.combobox.js line 1221

Error message
Uncaught TypeError: Cannot read properties of undefined (reading 'renderButton')

Line 1221

values: kendo.cssProperties.roundedValues.concat([['full', 'full']])

the debugger is highlighting the second 'full'.

Our code is quite complex but commenting most of it out I get the same thing so a simplified version:

Our html page has this input

<input id="departments" style="width: 500px;" />

Then our javascript to create the combobox is

var $combo = $("#departments);

objKendoCB = $combo.kendoComboBox();

The second line results in the error. (the actual code sets lots of properties but I removed them one by one to end up with an empty method call).

Any ideas welcome!

 

Simon
Top achievements
Rank 1
 asked on 03 Mar 2023
0 answers
36 views

I have Kendo Grid with "incell" editable mode and custom buttons for save, delete.

We have kendocombobox as editor and the user changes multiple rows before saving a row.

Is there a way to reset the previously edited row when the user moves to edit another row?

 

 

 

 

 

 

Shrenivas
Top achievements
Rank 1
 updated question on 03 Mar 2023
1 answer
82 views

Hello,

Cascading Comboboxes do not clear and reset values correctly when Virtualization is enabled.

I mimicked the bug though Codepen.

Find it here and follow instructions to reproduce the bug. 

Thank you.

Georgi Denchev
Telerik team
 answered on 06 Feb 2023
1 answer
155 views

I have a combo inside a column of the grid, i already managed to introduce a default value.
Now i need to block the combo actions, so the user cannot remove the default value.

My grid with combobox:

 

My code do default value inside combobox:

Nikolay
Telerik team
 updated answer on 03 Feb 2023
0 answers
66 views

Hello!

I could not manage to implement a combobox widget with virtualization if the text/value fields are set with values which are not in the datasoruce:

Here is an example code:


        $("#orders").kendoComboBox({
                template: '#= OrderID # | #= ShipName #',
                dataTextField: "ShipName",
                dataValueField: "OrderID",
              	text: 'Not in the list',
                value: 0,
                virtual: {
                    itemHeight: 26,
                    valueMapper: function(options) {
                        $.ajax({
                            url: "https://demos.telerik.com/kendo-ui/service/Orders/ValueMapper",
                            type: "GET",
                            dataType: "jsonp",
                            data: convertValues(options.value),
                            success: function (data) {
                                options.success(data);
                            }
                        })
                    }
                },
                height: 520,
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
                    },
                    pageSize: 80,
                    serverPaging: true,
                    serverFiltering: true
                }
            });

Robert
Top achievements
Rank 1
 asked on 23 Dec 2022
0 answers
46 views

Hi,

I want to add custom field to combobox Editor in Kendo grid but it's not working can anyone help me? Many thanks!
In the image below I have an IsActive : true column when loading data, but when I edit I don't see it.

Mr Chuc
Top achievements
Rank 2
Iron
 asked on 18 Nov 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?