Welcome Guest Search | Active Topics | Sign In | Register

Trimming the datepicker output size Options
Code Monkey
Posted: Wednesday, April 16, 2008 8:57:33 PM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2008
Posts: 37
I absolutely love the datepicker control. I have to say my favorite part beyond it 'just working' is the MinDate and MaxDate.

My situation is that I have an ASP.NET 2.0 DataList where every date field is editable (I hate the design, my client loves it). Unfortunately 5 datepickers for each row adds a lot of size to the rendered HTML content.

So far I've cut over 60KB from the output after finding this post on using an external CSS file.


Now my question.
I see the datepicker's calendar renders as a table and that each TD is rendered as:
Code: HTML/ASPX
<td align="center" valign="top" style="height:16px"><div height="100%" >14</div></td>

What I would like to do is use a CSS class for the TD. Is this possible? It doesn't seem like much gain but it is repeated so many times it is definitely adding up.

Also, any other tips for cutting down the render weight? I don't want to call it bloat but I wanted to add that word for anyone else searching like I did.

I know there might be something I can do with the scripts to extract them to the server that might help too but I haven't worked with that yet.

Thanks.
eo_support
Posted: Wednesday, April 16, 2008 9:24:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Unfortunately you won't be able to use a CSS class to replace those attributes. The best way for you to reduce the size is to reduce the number of DatePicker controls used. You can use the same DatePicker but move it to different location along with the list. Our Grid uses it this way:

http://www.essentialobjects.com/Demo/Default.aspx?path=Grid\_i1\_i6

The actual code used by to move the DatePicker is a bit complicated because it intends to work as many scenarios as possible. However it can be much simpler for a specific scenario, most of the time it would be work fine to just place the DatePicker inside a div, then absolute/relative position the div.

Thanks
Code Monkey
Posted: Wednesday, April 16, 2008 9:36:35 PM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2008
Posts: 37
Thanks for the quick reply. That demo you linked is awesome! I think that I will attempt to convert my page to use your grid in excel mode rather than trying to fix my page in its current form. I was just unaware of the excel mode of your grid before!

Ok I promise I'll read more documentation but I already had trouble with the grid. I made a new page, plopped a grid on it, clicked the edit columns, and any time I try to add one it just closes the dialog. If I set the style for the grid first, then when I try to edit the columns I get "object reference not set to an instance of an object". If you want I can make a new post for this question.

Thanks again!!
eo_support
Posted: Wednesday, April 16, 2008 9:41:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You mentioned about that "any time I try to add one it just close the dialog"...I am not sure how you use the Grid and dialog together. Can you create a sample page that demonstrates the problem? We will be happy to look into and see what we can find.

Thanks
Code Monkey
Posted: Wednesday, April 16, 2008 9:47:45 PM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2008
Posts: 37
Oh, no, you misunderstand, I meant dialog as the windows dialog for editing the columns. It just disappears.

Anyway after a little searching I found this post about it being a bug and the workaround to edit the columns from inside the grid editor itself.

Thanks!
eo_support
Posted: Wednesday, April 16, 2008 9:53:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I see. We have already fixed the bug but the new build hasn't been posted yet. So it will go away when we post our next build.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.