EasyUI Forum
April 24, 2024, 10:18:26 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Blank line on combobox when loaded from remote data  (Read 2844 times)
galcott
Newbie
*
Posts: 39


View Profile
« on: February 08, 2022, 04:35:15 PM »

When populating a combobox from a URL, I've noticed that the combobox has a blank item at the top even though the data doesn't have any blank records. This line is only about half the height of the data lines, as seen in this screen shot:
http://galcott.com/comfitdemo/combobox.jpg.

I don't want this line to appear at all so how can I get rid of it? This seems like a bug.
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #1 on: February 09, 2022, 12:41:03 AM »

I have this error some times, but every time it's a blank record. Look at your code again. It's not a bug ;-)
Logged
galcott
Newbie
*
Posts: 39


View Profile
« Reply #2 on: February 09, 2022, 09:01:32 AM »

Even if there is a blank record, it is a bug because the line is only half height which makes no sense. But in this case the table has no blank records, and I don't want an option for the field to be blank.
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #3 on: February 09, 2022, 02:15:15 PM »

When you populate the combobox, take the data and send me, and i will see if i can reproduce it in my setup


Logged
galcott
Newbie
*
Posts: 39


View Profile
« Reply #4 on: February 09, 2022, 04:24:28 PM »

Actually I have found a workaround for this. If you look in the debugger you can see that EasyUI creates IDs for each individual item in the combobox, as shown here.

The ID I used for the combobox is selShipMethod. So it takes this and adds on the rest of what you see here. I don't know what the "i4" part means, but the last digit is sequential so the first (blank) item will always be _0.
Code:
<div id="selShipMethod_easyui_combobox_i4_0" class="combobox-item combobox-item-selected"></div>
<div id="selShipMethod_easyui_combobox_i4_1" class="combobox-item">Next Day Priority</div>
<div id="selShipMethod_easyui_combobox_i4_2" class="combobox-item">Next Day Standard</div>

So in my style section I just add this CSS and that eliminates the blank line. Strangely, using display: none instead of visibility: hidden doesn't work.

Code:
#selShipMethod_easyui_combobox_i4_0 {visibility: hidden} 

Logged
galcott
Newbie
*
Posts: 39


View Profile
« Reply #5 on: February 09, 2022, 06:38:17 PM »

I checked my code again and it turns out that the PHP code to retrieve the records was inadverdently adding a blank record at the beginning. But the line being half height definitely is a bug, which can be fixed by using min-height in the CSS.
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #6 on: February 10, 2022, 12:33:41 AM »

Hi.

Nice that you found the error. As i said, i only had seen this when i had a blank line. If you need a blank line, it's of course a bug that it only is half height.

Write it in the group Bug Report

Jesper
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!