Skip to content

Commit 76dc321

Browse files
Merge pull request #2864 from syncfusion-content/EJ2-866032-customItem
documentation(866032): Documented the usage of adding a custom item using the itemTemplate
2 parents 2598a3e + 80d2d86 commit 76dc321

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

ej2-asp-core-mvc/ribbon/EJ2_ASP.MVC/items.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publishingplatform: ##Platform_Name##
88
documentation: ug
99
---
1010

11-
# Ribbon Items
11+
# Items in ASP.NET MVC Ribbon control
1212

1313
Ribbon renders various built-in items based on the item [Type](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Ribbon.RibbonItem.html#Syncfusion_EJ2_Ribbon_RibbonItem_Type) property. By default, the type property is set as `Button` which renders the Button.
1414

@@ -165,7 +165,7 @@ The [Target](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Ribbon.
165165
{% endhighlight %}
166166
{% endtabs %}
167167

168-
#### Customize Dropdown button item
168+
#### Customize dropdown button item
169169

170170
You can customize the dropdown button item by specifying a custom cssClass using the [beforeItemRender](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Ribbon.RibbonDropDownSettings.html#Syncfusion_EJ2_Ribbon_RibbonDropDownSettings_BeforeItemRender) event.
171171

@@ -504,7 +504,14 @@ You can customize the ribbon items with non-built-in items or HTML content by se
504504
{
505505
tab.Header("Home").Groups(group =>
506506
{
507-
group.Header("View").Collections(collection =>
507+
group.Header("Templates").IsCollapsible(false).Collections(collection =>
508+
{
509+
collection.Items(item =>
510+
{
511+
item.Type(RibbonItemType.Template).ItemTemplate("<div class="custom-template ${activeSize}"><label for="fname">First name:</label><input type="text" id="fname" name="fname"/><br/><br/><label for="lname">Last name:</label><input type="text" id="lname" name="lname"></div>").Add();
512+
}).Add();
513+
}).Add();
514+
group.Header("Multimedia").Collections(collection =>
508515
{
509516
collection.Items(item =>
510517
{
@@ -540,6 +547,20 @@ You can customize the ribbon items with non-built-in items or HTML content by se
540547
.ribbonTemplate.Small .text {
541548
display: none;
542549
}
550+
551+
.custom-template input {
552+
margin-left: 10px;
553+
width: 100px;
554+
}
555+
556+
.custom-template.Medium {
557+
display: flex;
558+
align-items: center;
559+
}
560+
.custom-template.Medium input {
561+
height: 14px;
562+
margin-right: 10px;
563+
}
543564
</style >
544565

545566
{% endhighlight %}

ej2-asp-core-mvc/ribbon/EJ2_ASP.NETCORE/items.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publishingplatform: ##Platform_Name##
88
documentation: ug
99
---
1010

11-
# Ribbon Items
11+
# Items in ASP.NET Core Ribbon control
1212

1313
Ribbon renders various built-in items based on the item [type](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Ribbon.RibbonItem.html#Syncfusion_EJ2_Ribbon_RibbonItem_Type) property. By default, the type property is set as `Button` which renders the Button.
1414

@@ -177,7 +177,7 @@ The [target](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Ribbon
177177
{% endhighlight %}
178178
{% endtabs %}
179179

180-
#### Customize Dropdown button item
180+
#### Customize dropdown button item
181181

182182
You can customize the dropdown button item by specifying a custom cssClass using the [beforeItemRender](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Ribbon.RibbonDropDownSettings.html#Syncfusion_EJ2_Ribbon_RibbonDropDownSettings_BeforeItemRender) event.
183183

@@ -536,7 +536,17 @@ You can customize the ribbon items with non-built-in items or HTML content by se
536536
<e-ribbon-tabs>
537537
<e-ribbon-tab header="Home">
538538
<e-ribbon-groups>
539-
<e-ribbon-group header="Font">
539+
<e-ribbon-group header="Templates" isCollapsible=false>
540+
<e-ribbon-collections>
541+
<e-ribbon-collection>
542+
<e-ribbon-items>
543+
<e-ribbon-item type=Template itemTemplate='<div class="custom-template ${activeSize}"><label for="fname">First name:</label><input type="text" id="fname" name="fname"/><br/><br/><label for="lname">Last name:</label><input type="text" id="lname" name="lname"></div>'>
544+
</e-ribbon-item>
545+
</e-ribbon-items>
546+
</e-ribbon-collection>
547+
</e-ribbon-collections>
548+
</e-ribbon-group>
549+
<e-ribbon-group header="Multimedia">
540550
<e-ribbon-collections>
541551
<e-ribbon-collection>
542552
<e-ribbon-items>
@@ -578,6 +588,19 @@ You can customize the ribbon items with non-built-in items or HTML content by se
578588
display: none;
579589
}
580590

591+
.custom-template input {
592+
margin-left: 10px;
593+
width: 100px;
594+
}
595+
596+
.custom-template.Medium {
597+
display: flex;
598+
align-items: center;
599+
}
600+
.custom-template.Medium input {
601+
height: 14px;
602+
margin-right: 10px;
603+
}
581604
</style>
582605

583606
{% endhighlight %}
Loading

0 commit comments

Comments
 (0)