PDA

View Full Version : Moving style from script to CSS



Anders Ohrt
15-May-2007, 08:28 AM
I've started working with the library now, and noticed a lot of style
(float, margins, etc) is applied to object by the scripts. I was forced to
change this in order for the objects to fit our look-and-feel, so I would
prefer it this could be moved to the CSS instead of being hardcoded in the
scripts. For example height, float, and margins for the scrollbar are
assigned via calculations on the parent grid. You can't override style that
is places in an element directly, so I was had to hunt in the scripts
themselves and comment stuff out.

I know it's easier to put it in the scripts if you want the standard
look-and-feel, but once you want to customize this it turns into a
nightmare.

// Anders

Edwin van der Velden
15-May-2007, 09:10 AM
I agree that it would be preferable to make it pure CSS instead of adding
them inline, but I'm not sure if that's possible to achieve. If there are
calculations needed to get the right values then you have no other option
then to add it through javascript.

I have noted it down on the todo list and will look into it.

Regards,

Edwin van der Velden


"Anders Öhrt" <Anders.Ohrt@berendsen.se> wrote in message
news:1ABbzTvlHHA.312@dacmail.dataaccess.com...
>
> I've started working with the library now, and noticed a lot of style
> (float, margins, etc) is applied to object by the scripts. I was forced to
> change this in order for the objects to fit our look-and-feel, so I would
> prefer it this could be moved to the CSS instead of being hardcoded in the
> scripts. For example height, float, and margins for the scrollbar are
> assigned via calculations on the parent grid. You can't override style
> that is places in an element directly, so I was had to hunt in the scripts
> themselves and comment stuff out.
>
> I know it's easier to put it in the scripts if you want the standard
> look-and-feel, but once you want to customize this it turns into a
> nightmare.
>
> // Anders
>

Anders Ohrt
15-May-2007, 10:07 AM
I understand why it is done this way, but all values that are calculated
could be placed in CSS instead and calculated at design time with a
calculator instead of runtime by the client. =)

What I wanted to achive was making the webapp look like a plain VDF
application but in XP style, so the scrollbar should continue past the
header and not just the over the "window" part.

Another request, is it possible to detect when the list doesn't need a
scrollbar at all and place a "disabled" scrollbar instead?

// Anders


>I agree that it would be preferable to make it pure CSS instead of adding
>them inline, but I'm not sure if that's possible to achieve. If there are
>calculations needed to get the right values then you have no other option
>then to add it through javascript.
>
> I have noted it down on the todo list and will look into it.
>
> Regards,
>
> Edwin van der Velden
>
>
> "Anders Öhrt" <Anders.Ohrt@berendsen.se> wrote in message
> news:1ABbzTvlHHA.312@dacmail.dataaccess.com...
>>
>> I've started working with the library now, and noticed a lot of style
>> (float, margins, etc) is applied to object by the scripts. I was forced
>> to change this in order for the objects to fit our look-and-feel, so I
>> would prefer it this could be moved to the CSS instead of being hardcoded
>> in the scripts. For example height, float, and margins for the scrollbar
>> are assigned via calculations on the parent grid. You can't override
>> style that is places in an element directly, so I was had to hunt in the
>> scripts themselves and comment stuff out.
>>
>> I know it's easier to put it in the scripts if you want the standard
>> look-and-feel, but once you want to customize this it turns into a
>> nightmare.
>>
>> // Anders
>>
>
>

Edwin van der Velden
16-May-2007, 02:39 AM
Well, true since the height of for example a grid is pre-defined it could
be. I was thinking more in the lines of variable height of the scrollbar
when the amount of records changes but I don't think that happens a lot or
at all now that I think of it :) Only thing I'm unsure of is the location of
the slider, I don't know how that exactly works at the moment but that might
work just fine since you should just need to know the location and height of
the scrollbar.

I think it should not be that hard to detect whether or not a scrollbar is
actually necessary, I will have a look at that as well.

-Edwin

"Anders Öhrt" <Anders.Ohrt@berendsen.se> wrote in message
news:nUiAvKwlHHA.312@dacmail.dataaccess.com...
>
> I understand why it is done this way, but all values that are calculated
> could be placed in CSS instead and calculated at design time with a
> calculator instead of runtime by the client. =)
>
> What I wanted to achive was making the webapp look like a plain VDF
> application but in XP style, so the scrollbar should continue past the
> header and not just the over the "window" part.
>
> Another request, is it possible to detect when the list doesn't need a
> scrollbar at all and place a "disabled" scrollbar instead?
>
> // Anders
>
>
>>I agree that it would be preferable to make it pure CSS instead of adding
>>them inline, but I'm not sure if that's possible to achieve. If there are
>>calculations needed to get the right values then you have no other option
>>then to add it through javascript.
>>
>> I have noted it down on the todo list and will look into it.
>>
>> Regards,
>>
>> Edwin van der Velden
>>
>>
>> "Anders Öhrt" <Anders.Ohrt@berendsen.se> wrote in message
>> news:1ABbzTvlHHA.312@dacmail.dataaccess.com...
>>>
>>> I've started working with the library now, and noticed a lot of style
>>> (float, margins, etc) is applied to object by the scripts. I was forced
>>> to change this in order for the objects to fit our look-and-feel, so I
>>> would prefer it this could be moved to the CSS instead of being
>>> hardcoded in the scripts. For example height, float, and margins for the
>>> scrollbar are assigned via calculations on the parent grid. You can't
>>> override style that is places in an element directly, so I was had to
>>> hunt in the scripts themselves and comment stuff out.
>>>
>>> I know it's easier to put it in the scripts if you want the standard
>>> look-and-feel, but once you want to customize this it turns into a
>>> nightmare.
>>>
>>> // Anders
>>>
>>
>>
>
>