Telerik Forums
Kendo UI for jQuery Forum
3 answers
2.6K+ views

I have used Kendo Dropdownlist , to display information in list. Here my requirement is to add the bellow  mention styles i.e. (.k-list-container and .k-list-scroller ) to Dropdownlist using JavaScript.

And make the height of ".k-list-scroller" dynamic i.e. the drop down  list-area when selected, the height of it, should go beyond screen height or window height. In this case i have hard coded (height: 500px !important;).

.k-list-container{
        width:  auto !important;
        height: auto !important;
    }
 
    .k-list-scroller{
      height: 500px !important;
      overflow-y: scroll !important;
    }

 

The bellow code example is for reference -

<style>
  .k-list
  {
    white-space: nowrap;
  }
  .k-list-container{
        width:  auto !important;
        height: auto !important;
    }
    .k-list-scroller{
      height: 500px !important;
      overflow-y: scroll !important;
    }
</style>
<div id="example">
    <p>
     data: <select id="local"></select>
  </p>
</div>
<script>
  $(function() {
    var data = [
      { text: "Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey ", value: "13" },
      { text: "Black 1", value: "1" },
      { text: "Orange 2", value: "2" },
      { text: "Black 3", value: "3" },
      { text: "Orange 4", value: "4" },
      { text: "Black 5", value: "5" },
      { text: "Orange 6", value: "6" },
      { text: "Black 7", value: "7" },
      { text: "Orange 8", value: "8" },
      { text: "Black 9", value: "9" },
      { text: "Orange 10", value: "10" },
      { text: "Black 11", value: "11" },
      { text: "Orange 12", value: "12" },
      { text: "Black 1", value: "1" },
      { text: "Orange 2", value: "2" },
      { text: "Black 3", value: "3" },
      { text: "Orange 4", value: "4" },
      { text: "Black 5", value: "5" },
      { text: "Orange 6", value: "6" },
      { text: "Black 7", value: "7" },
      { text: "Orange 8", value: "8" },
      { text: "Black 9", value: "9" },
      { text: "Orange 10", value: "10" },
      { text: "Black 11", value: "11" },
      { text: "Orange 12", value: "12" },
      { text: "Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey Grey ", value: "13" },
      { text: "Black 1", value: "1" },
      { text: "Orange 2", value: "2" },
      { text: "Black 3", value: "3" },
      { text: "Orange 4", value: "4" },
      { text: "Black 5", value: "5" },
      { text: "Orange 6", value: "6" },
      { text: "Black 7", value: "7" },
      { text: "Orange 8", value: "8" },
      { text: "Black 9", value: "9" },
      { text: "Orange 10", value: "10" },
      { text: "Black 11", value: "11" },
      { text: "Orange 12", value: "12" },
      { text: "Black 1", value: "1" },
      { text: "Orange 2", value: "2" },
      { text: "Black 3", value: "3" },
      { text: "Orange 4", value: "4" },
      { text: "Black 5", value: "5" },
      { text: "Orange 6", value: "6" },
      { text: "Black 7", value: "7" },
      { text: "Orange 8", value: "8" },
      { text: "Black 9", value: "9" },
      { text: "Orange 10", value: "10" },
      { text: "Black 11", value: "11" },
      { text: "Orange 12", value: "12" }
    ];
      
    $("#local").kendoDropDownList({
      dataTextField: "text",
      dataValueField: "value",
      dataSource: data,
   
    });
    });
</script>
</body>
</html>

Thanks

Martin
Telerik team
 answered on 04 Apr 2019
3 answers
3.3K+ views

Hi there

In this example:

$("#employeeGridDiv").kendoGrid({
        dataSource: {
            type: "odata",
            transport: {
                read: {
                    type: 'GET',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    url: '@Url.Action("LoadEmployeeGrid", "EmployeePanel")'
                }
            },
            pageSize: 20
        },
        groupable: true,
        sortable: true,
        pageable: {
            refresh: true,
            pageSizes: true,
            buttonCount: 5
        },
       
        columns: {
                    type: 'GET',
                    contentType: "text/html",
                    url: '@Url.Action("LoadEmployeeGridColumns", "EmployeePanel")'
        }
    });

I'm trying to populate the columns from the controller method LoadEmployeeGridColumns which returns the JSON representation of the following:

 public class GridCellClass
    {
        public string field { get; set; }
        public string title { get; set; }
        public string template { get; set; }
        public int width { get; set; }
        public bool visible { get; set; }
        public string format { get; set; }
        public string attributes { get; set; }

}

It does not work. How exactly should the "columns" portion be implemented?

Thanks.

Georgi
Telerik team
 answered on 04 Apr 2019
1 answer
591 views

I have a grid which has two columns ,when i click on the first column content i want it to show me a message box,but the problem is when i click on the message box,it does not go away compeltly,the nmessage box shadow is still there ,what im doing is:

 

  $("#gridProAvail").kendoTooltip({
               filter: "td",
               content: toolTip,
               width: 400,
               height: 100,
               position: "top"
           });

         
          $("#gridProAvail").click(toolTip);

      function toolTip(e) {
         var target = $(e.target);
         if(e.target[0].cellIndex == 0) {
         var cellInfo = e.target[0].innerHTML;
         alert(cellInfo);
         grid.dataSource.read();
         }

        
i need the content to be shown in the tool tip
               
       

Viktor Tachev
Telerik team
 answered on 04 Apr 2019
1 answer
347 views

I've bound data sources to grids and dropdownlist widgets but I haven't seen many examples or binding the data in a datasource to simple multiple labels or textboxes on a page load (in MVVM preferably).    I can bind it to a simple variable defined in the observable objects but how can I bind it to a datasource value like an array of objects?  

<script id="index" type="text/x-kendo-template">

<span data-bind="text: someTextValue"></span>

<span data-bind="text: someTextValue2"></span>

</script>

 

 

var viewModelIndex = kendo.observable({

someTextValue: '12345',

someTextValue2: '12345',

fruits: new kendo.data.DataSource({
data: [
{ id: 1, name: "Apples" },
{ id: 2, name: "Oranges" },
{ id: 3, name: "Bananas" }
],
schema: {
model: {
fields: {
id: { type: "number" },
name: { type: "string" }
}
}
}
}),

 

 

});

 

 

.

Perry
Top achievements
Rank 1
 answered on 03 Apr 2019
3 answers
189 views

 I am trying to use numeric textbox inside treeview template. When I try to focus the textbox, it doesn't focuses and lost the focus. Since I wasn't able to change the values. I tried using mvvm binding from html and its not working either. 

P.S I had to use numerictextbox because of the formatting reasons. Below is the sample url i have tried,

https://dojo.telerik.com/@paulrajj/OmOdilij/2

Kindly let me know if there is any solutions to fix this. 

Petar
Telerik team
 answered on 03 Apr 2019
3 answers
183 views

I manage to make anything work with the , where ever I try to use one, grid or .

my code is: 

 

thanks for the assistance

 

 var customersData = new kendo.data.DataSource({
            dataSource: {
                type: "odata",
                transport: {
                    read: {
                        url: SCH.webapp_api + '/scheduler/customers/data',
                        dataType: "json",
                        type: "GET",
                        cache: false,
                    },
                    schema: {                       
                        model: {
                            fields: {
                                id: { type: "number" },
                                name: { type: "string" },
                                company: { type: "string" },
                            }
                        }
                    }
                },
                autoSync: true,
                serverFiltering: true,
            }
        });

        $("#customers").kendoDropDownList({
            optionLabel: "Choose a customer",
            filter: "contains",
            dataTextField: "name",
            dataValueField: "id",
            dataSource: customersData,
            index: 0
        });

Petar
Telerik team
 answered on 03 Apr 2019
1 answer
166 views

Is it possible to initialize a grid from an table with hierarchy inside?

 

thanks

Georgi
Telerik team
 answered on 03 Apr 2019
5 answers
413 views

Hi.

What is the preferred way of hiding/showing kendo controls in Angular? There are some options:

- ng-show
- ng-if
- k-visible

Beside the obvious difference between the first two, what are the complications of hiding/removing a wrapper DOM element as opposed to using k-visible. Are there any differences in performance, memory usage, etc. to be aware of?

Cheers,
JH

Veselin Tsvetanov
Telerik team
 answered on 03 Apr 2019
2 answers
146 views

Hi,

I'm using Node.js configured with DataSource. All was working fine. We switched from mysql to Postgres and now the Grids don't populate with the returned data. Before pasting tons of code here, checking if I missed something obvious:

I added the following change event function to the transport, and in the Chrome debugger I see the expected rows are returned in the results. What I don't know if the data object stores the rows in some new or unexpected way. There's an element called "0" with child array called "rows" which has the correct number of rows, populated with the correct data and elements named correctly. I also checked the element names throughout and they match. 

Any tips on how to debug whether the grid is receiving the update?

change: function(e) {
    var data = this.data();
    console.log(data);
}

Brett
Top achievements
Rank 1
 answered on 02 Apr 2019
7 answers
302 views
For following configuration, when all childs of a node are selected, parent nodes are also counted. It causes misunderstanding. If it is not possible to count only leaves, how can a fixed message be displayed.

                checkboxes: { checkChildren: true },
                messages: {
                    singleTag: " selected"
                },
                tagMode: "single",
Andrea
Top achievements
Rank 2
Iron
 answered on 02 Apr 2019
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?