EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: galcott on February 08, 2022, 04:35:15 PM



Title: Blank line on combobox when loaded from remote data
Post by: galcott 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 (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.


Title: Re: Blank line on combobox when loaded from remote data
Post by: jega 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 ;-)


Title: Re: Blank line on combobox when loaded from remote data
Post by: galcott 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.


Title: Re: Blank line on combobox when loaded from remote data
Post by: jega 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




Title: Re: Blank line on combobox when loaded from remote data
Post by: galcott 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} 



Title: Re: Blank line on combobox when loaded from remote data
Post by: galcott 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.


Title: Re: Blank line on combobox when loaded from remote data
Post by: jega 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