Using javascript key event set fixed height for particular class

Viewed 44

Used webix,to create datatable that contains combo editor. These combo has drop down list, it gets cut when we enter any key. As these list is dynamically generated. I want to assign some fixed height for this list. I used below code,

on:{
   onkeypress:function(){
    $('.webix_popup').css("height","100px");
    $('.webix_list').css("height","100px");
   }
 }

I tried the above code but it didn't work for all keys, it works when i entered c, d, g, m, n, p, q key from keyboard. I am not getting these behavior. Please can anybody tell me the solution.

1 Answers

To define fixed height, you can set it in the suggest property (just using Webix config, no need to use JQuery):

{
    view:"datatable",
    columns:[
      { id:"year", editor:"combo", collection:years,
       suggest:{
         height:100,
         body:{
           autoheight:false
         }
       },
       header:"Released" , width:100},
      { id:"votes", editor:"text", header:"Votes", width:100}
    ],
    editable:true,
    // ...
}

https://snippet.webix.com/v2kkyacx

Related