Jul 09, 2012, 1:52 AM
[CLOSED] [2.0] DataView with Razor Data
Hello,
When using the following example below, I'm unable to select (click) on objects, even though I have my CSS rules defined:
Any suggestions? Or have you run into anything similar?
Cheers,
Timothy
When using the following example below, I'm unable to select (click) on objects, even though I have my CSS rules defined:
Html.X().Panel()
.BodyPadding(15)
.Border(false)
.Layout(LayoutType.Fit)
.Items(a =>
{
a.Add(Html.X().DataView()
.ItemSelector("div.icon")
.OverItemCls("icon-hover")
.SelectedItemCls("icon-selected")
.TrackOver(true)
.Control(control =>
control.Data = Model.GetValues()
.Select(m => new
{
Id = m.Id,
DisplayName = m.DisplayName
} )
.ToList()
)
.Store(store =>
store.Add(Html.X().Store()
.Model(model =>
model.Add(Html.X().Model()
.IDProperty("Id")
.Fields(fields =>
{
fields.Add(Html.X().ModelField()
.Name("Id")
);
fields.Add(Html.X().ModelField()
.Name("DisplayName")
.Type(ModelFieldType.String)
);
} )
)
)
)
)
.Tpl(Html.X().XTemplate()
.Html(@"
<tpl for=""."">
<div class=""icon module"">
<div class=""icon-title"">{DisplayName}</div>
<div class=""icon-description"">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pellentesque interdum dolor quis iaculis. Ut non lorem tellus. Etiam augue erat, tincidunt ut convallis blandit, ornare aliquam urna. Vestibulum vulputate quam ultrices urna cursus consectetur. Integer at libero orci. Etiam fringilla porttitor metus ut vestibulum.</div>
</div>
</tpl>
")
)
);
} )
)
Works everywhere else in my code, where I am using a proxy to load the data instead.Any suggestions? Or have you run into anything similar?
Cheers,
Timothy
Last edited by Daniil; Jul 09, 2012 at 7:32 PM.
Reason: [CLOSED]