[]
Sheets.Touch.TouchToolStripItem
• new TouchToolStripItem(name
, text
, image
, command?
, canExecute?
)
Represents an item in the toolbar.
example
//This example adds a delete image with red text.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ }))
spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red");
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
Name | Type | Description |
---|---|---|
name |
string |
The name of the item. |
text |
string |
The item text. |
image |
string |
The item image source. |
command? |
any |
Defines the executive function that occurs when the user taps the item. |
canExecute? |
Function |
Defines when to show the item by a function. If returns true , display the item; otherwise, hide the item. |
▸ font(value?
): any
Gets or sets the font of the item text.
example
//This example adds a delete image with red text.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ }))
spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red");
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the font of the item text; otherwise, returns the toolbar item.
▸ foreColor(value?
): any
Gets or sets the color of the item text.
example
//This example adds a delete image with red text.
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ }))
spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red");
spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator());
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the color of the item text; otherwise, returns the toolbar item.
▸ image(value?
): any
Gets or sets the source of the item image.
example
//This example adds a delete image with red text.
var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem();
tts.image("cut.png");
tts.name("C");
tts.text("Delete");
spread.touchToolStrip.add(tts, function(){ });
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the source of the item image; otherwise, returns the toolbar item.
▸ name(value?
): any
Gets or sets the name of the item.
example
//This example adds a delete image with red text.
var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem();
tts.image("cut.png");
tts.name("C");
tts.text("Delete");
spread.touchToolStrip.add(tts, function(){ });
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the name of the item; otherwise, returns the toolbar item.
▸ text(value?
): any
Gets or sets the text of the item.
example
//This example adds a delete image with red text.
var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem();
tts.image("cut.png");
tts.name("C");
tts.text("Delete");
spread.touchToolStrip.add(tts, function(){ });
spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red");
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the text of the item; otherwise, returns the toolbar item.