ejToolbar
Namespace: Wisej.Web.Ext.Syncfusion
Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)
The Toolbar control supports displaying a list of tools within a web page. This control is capable of customizing toolbar items with any functionality by using enriched client-side methods. This control is composed of collection of unordered lists containing text and images contained into a div.
- C#
- VB.NET
public class ejToolbar : ejBase
Public Class ejToolbar
Inherits ejBase
Constructors
ejToolbar()
Constructs a new instance of the ejToolbar class.
Example:
The following example creates the toolbar and binds it to a list of tools through the options.
var toolbar = new ejToolbar();
toolbar.Options.dataSource = new[]
{
new { id = "new", text = "New", tooltipText = "Create a document" },
new { id = "open", text = "Open", tooltipText = "Open a document" },
new { id = "save", text = "Save", tooltipText = "Save the document" }
};
toolbar.Options.fields = new { id = "id", text = "text", tooltipText = "tooltipText" };
toolbar.Dock = DockStyle.Top;
this.Controls.Add(toolbar);
ejToolbar(options)
Constructs a new instance of the ejToolbar class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a toolbar and sends the id of the clicked tool to the server using a JavaScript handler, since the event data sent to the server does not include the clicked element.
var toolbar = new ejToolbar(new
{
dataSource = tools,
fields = new { id = "id", text = "text" }
});
toolbar.WidgetEvents = new[]
{
new ejBase.WidgetEventHandler
{
Name = "click",
Source = "e.container.fireWidgetEvent('toolClick', { id: $(e.currentTarget).attr('id') });"
}
};
toolbar.WidgetEvent += (s, e) =>
{
if (e.Type == "toolClick")
AlertBox.Show($"Tool: {e.Data.id}");
};
toolbar.Dock = DockStyle.Top;
this.Controls.Add(toolbar);