Grid - changing my css??

4 views
Skip to first unread message

Sam

unread,
Dec 10, 2009, 10:51:04 AM12/10/09
to mvccontrib-discuss
Ok, this is weird.

I have this:

Html.Grid(Model).AutoGenerateColumns().Attributes(@class => "hover")

But when I add an "Id" by chaining Attributes like so:

Html.Grid(Model).AutoGenerateColumns().Attributes(@class =>
"hover").Attributes(@id => "ServiceGrid")


My css automagically changes to "grid". So rather I changed my
implementation to:

Html.Grid(Model).AutoGenerateColumns().Attributes(@id =>
"ServiceGrid", @class => "hover")

Which worked. But I'm concerned that Attributes even shows as a
method chaining candidate if the end result is not cumulative effect
that we would expect out of chaining like other frameworks. Am I
missing something?

Jeremy Skinner

unread,
Dec 10, 2009, 12:06:55 PM12/10/09
to mvccontri...@googlegroups.com
The grid does not currently support multiple calls to Attributes - the final call always takes precedence.

Jeremy

2009/12/10 Sam <sam...@gmail.com>

--
Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project.  Or go to http://mvccontrib.org

To unsubscribe from this group, send email to mvccontrib-disc...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mvccontrib-discuss?hl=en

Sam

unread,
Dec 10, 2009, 7:22:34 PM12/10/09
to mvccontrib-discuss
Thanks.

On Dec 10, 11:06 am, Jeremy Skinner <jer...@jeremyskinner.co.uk>
wrote:
> The grid does not currently support multiple calls to Attributes - the final
> call always takes precedence.
>
> Jeremy
>
> 2009/12/10 Sam <sam....@gmail.com>
>
> > Ok, this is weird.
>
> > I have this:
>
> > Html.Grid(Model).AutoGenerateColumns().Attributes(@class => "hover")
>
> > But when I add an "Id" by chaining Attributes like so:
>
> > Html.Grid(Model).AutoGenerateColumns().Attributes(@class =>
> > "hover").Attributes(@id => "ServiceGrid")
>
> > My css automagically changes to "grid".  So rather I changed my
> > implementation to:
>
> > Html.Grid(Model).AutoGenerateColumns().Attributes(@id =>
> > "ServiceGrid", @class => "hover")
>
> > Which worked.  But I'm concerned that Attributes even shows as a
> > method chaining candidate if the end result is not cumulative effect
> > that we would expect out of chaining like other frameworks.  Am I
> > missing something?
>
> > --
> > Contact Jeffrey Palermo or Eric Hexter with specific questions about the
> > MvcContrib project.  Or go tohttp://mvccontrib.org
Reply all
Reply to author
Forward
0 new messages