|
Rank: Member Groups: Member
Joined: 9/23/2010 Posts: 15
|
This is a strange one. I am using datepicker and the basic functionality is excellent and working well but I am having a page layout problem in IE that I do not see in FireFox, Safari, Opera or Chrome (big surprise eh?).
Basically in IE I am getting significant blank space between the datepicker and the next control on the line (a dropdown to specify time). I have tried putting everything in a table and controlling the cell width for the datepicker but the problem persists. I get precisely what I want in most browsers but a problem with IE (currently IE8)
Any suggestions for what the problem is or how to workaround would be welcomed.
Thanks
Alistair
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Check your CSS files. This usually is caused by your CSS rules. For example, if you have a rule that applies margins to all DIVs, then they will be picked up by DIVs used inside our DatePicker. You will have to change the scope of such rules so that it only applies to their intended targets.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/23/2010 Posts: 15
|
Hmm.
OK I checked the CSS files and nothing suggests a problem. I didn't expect one since the layout is fine on 4 out of 5 browsers tested and I don't have any browser specific CSS code at this point (do I see some in my future). Unfortunately IE is by far the most prominent browser so I need a layout that works in that. Oh..and I don't have any CSS decoration being applied to div elements at all; I always declare that sort of stuff as a class and apply it only where it is needed.
This is very frustrating because everything else about DatePicker is working beautifully.
Alistair
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can test the DatePicker in a blank page (without master page) and see if it works. If that still does not work, send the test project with the blank page to us and we will be happy to take a look.
If that works and your page does not, then the problem is triggered by something else in your page. More than 95% of time such problems are caused by your CSS. Sometimes it can be caused by invalid HTML (such as unclosed tags), sometimes can be caused by your code. Just try to removing them block by block and you will find out what triggered it.
Thanks
|
|
Rank: Member Groups: Member
Joined: 9/23/2010 Posts: 15
|
Good suggestion, thanks.
It was not CSS as I had already confirmed and I now find that inline layout does not work for ANY browser. I MUST use a table to get it to layout properly. It's as if the control renders a line break before and after itself which I think is significant to the overall behavior I saw.
The problem turns out to be how IE renders complex tables that contain a datepicker. The controls were in a table with different cell merges on different rows to create the overall form design and it works fine for most browsers...the HTML is correct. It is an interaction between the IE table rendition engine and the datepicker (if I replace the problem datepickers with textboxes the problem magically goes away).
In this case the workaround I used was to split the main table and isolate the datepicker rows into their own table between a top and bottom table for the rest of the form. Clumsy bit it works.
Thanks
Alistair
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That is a bit strange. However I am glad that you found out. DatePicker is a block element by default, TextBox is an inline element by default. So that might have something to do with it. You can change the DatePicker from block to inline by applying style="display:inline" on it.
Thanks
|
|
Rank: Member Groups: Member
Joined: 9/23/2010 Posts: 15
|
Wow...talk about an undocumented feature...I just trawled the docs to find any reference to the display:inline tip you provided (it works...thanks). And I note the style property is not even listed against the datepicker (or appears in the Intellisense list in VS). You really have to know about it, there's no reasonable way to discover it!
I wonder how many more hidden gems there are?
Alistair
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This is not an undocumented feature. This is just standard CSS.
Thanks
|
|