TX Text Control .NET Server for ASP.NET X18 implements the new class InputFormat TX Text Control .NET Server for ASP.NET
JavaScript API
InputFormat Object
The InputFormat object represents all formatting attributes at the current text input position.
in the JavaScript API that enables you to create your own custom button bar. This can be helpful when the ribbon interface provides too many features and a more simplistic UI is required.

Custom button bar

Therefore, a simple Bootstrap toolbar is used with Font Awesome icons:

Loading...

In this sample, the naming of the button id values is very important as they match exactly the member names in the InputFormat class. Let's take a closer look at the Bold button for instance:

Loading...

The id is txBtn_Bold. The string part after the hyphen matches the name of the InputFormat get/set method name. In this case, it is the getBold TX Text Control .NET Server for ASP.NET
JavaScript API
InputFormat Object
getBold Method
Gets a value specifying whether text is bold at the current input position.
method.

The following JavaScript code loops through all buttons in the custom toolbar in order to extract the button feature name from the id attribute. A click event handler is attached to each button that sets the new input format. Additionally, the inputFormat.addEventListener TX Text Control .NET Server for ASP.NET
JavaScript API
InputFormat Object
addEventListener Method
The addEventListener function registers event listener functions on the InputFormat object.
is attached for the associated input format to update the button state based on the current input position.

Loading...

The setInputFormat function is calling the associated set method for the specific input format:

Loading...

Thanks to this very generic JavaScript function, events and functionality is attached to all buttons automatically.

Feel free to download the project from our GitHub repository and try this on your own.