Spread for ASP.NET 12 Product Documentation
TouchStrip
Spread for ASP.NET 12 Product Documentation > Client-Side Scripting Reference > Scripting Members > Classes > TouchStrip

The client-side TouchStrip class contains the following members.

Constructor Description
public TouchStrip() Creates a new instance of the touch strip that represents the touch menu bar
public TouchStrip(htmlTouchStrip: HTMLElement) Creates a new instance of the touch strip that represents the touch menu bar

 

Property Description
public TouchStripItem[] Items {get;} Provides access to the items list of a touch strip
public TouchStripShowingArea Area {get;} Gets the TouchStripShowingArea where the touch strip is displayed
public FpSpread Spread {get;} Gets the Spread which owns the current touch strip
public ToolStripDropDown DroppedDownMenu {get;} Gets the current active child menu

 

Method Description
public bool Show(x: number, y: number, spread: IFpSpread); Shows the Spread touch strip at the specified location. Returns true if the touch strip is displayed; otherwise, false
public bool Show(x: number, y: number, spread: IFpSpread, area: TouchStripShowingArea); Displays the Spread touch strip at the specified location. Returns true if the touch strip is displayed; otherwise, false
public void Hide(); Hides the touch strip
public HTMLElement Refresh(); Updates the generated HTML of the touch strip menu
public void AddEventListener(string eventName, EventListener listener) Registers an event listener on the event target object
public void RemoveEventListener(string eventName, EventListener listener) Unregisters an event listener on the event target object
public void OnItemClick(Event event) Occurs when the user clicks into an enabled menu item
public void Refresh() Updates the generated HTML of the ToolStripDropDown menu

 

Event Description
public event Clicked(TouchStripItemClickedEventArgs); Occurs when the Spread TouchStrip item is selected

Example

This is a sample that creates a touch strip. On the client side, the script would look like this:

JavaScript
Copy Code

<script type="text/javascript">

window.onload = function () {
    var spread = document.getElementById("FpSpread1");
   
        spread.addEventListener("TouchStripOpening", function (e) {
            var touchStrip = new FarPoint.Web.Spread.TouchStrip();
            touchStrip.Items.push(new FarPoint.Web.Spread.TouchStripItem("Test"));
            touchStrip.Show(e.X, e.Y, e.Spread, e.Area);
            e.Handled = true;
            touchStrip.AddEventListener("Clicked", function (e) { //global touch strip event
                alert("Clicked");
            });
            touchStrip.Items[0].AddEventListener("Clicked", function (e) { //touch strip item event
                alert("menu item");
            });
         });
}

</script>