PDA

View Full Version : [CLOSED] html tags inside panel's items



sharmav1
Oct 07, 2015, 1:34 PM
Hi,

I want to embed HTML tags inside Panel's Items collection. How can I do that? Below piece of code I took from http://mvc.ext.net/#/Form_ComboBox/Custom_Search/

Ex:


HTML.X.Panel().Items
(
// **** Custom Search Code
<div style="width:600px;">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;">Search the plants</h3>

@(Html.X().ComboBox()
.DisplayField("Common")
.ValueField("Common")
.TypeAhead(false)
.Width(500)
.PageSize(10)
.HideTrigger(true)
.MinChars(0)
.TriggerAction(TriggerAction.Query)
.ListConfig(Html.X().BoundList()
.LoadingText("Searching...")
.ItemTpl(Html.X().XTemplate()
.Html(@<text>
<div class="search-item">
<h3><span>${Price}</span>{Common}</h3>
{Botanical}
</div>
</text>)
)
)
.Store(Html.X().Store()
.AutoLoad(false)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("GetPlants"))
.ActionMethods(am => am.Read = HttpMethod.POST)
.Reader(Html.X().JsonReader().RootProperty("data"))
)
.Model(Html.X().Model()
.Fields(
Html.X().ModelField().Name("Common"),
Html.X().ModelField().Name("Botanical"),
Html.X().ModelField().Name("Light"),
Html.X().ModelField().Name("Price").Type(ModelFieldType.Float),
Html.X().ModelField().Name("Indoor").Type(ModelFieldType.Boolean)
)
)
)
)
<div style="padding-top:4px;">
Plants search (type '*' (asterisk) for showing all)
</div>
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
</div>
)

Thanks

Daniil
Oct 07, 2015, 2:42 PM
Hi @sharmav1,

A Panel's Items can only hold Ext.NET components.

You can put HTML markup into Content:
http://forums.ext.net/showthread.php?20217&p=87302&viewfull=1#post87302