Constructor
new CheckItem(data)
Parameters:
Name | Type | Description |
---|---|---|
data |
(Object} key/value pairs of information, must at least contain "id", can basically just pass in response from Trello API |
- Source:
Examples
card.checklist("Something").item(new RegExp("Process.*")).remove();
card.checklist("Something").item(new RegExp("Process.*")).mark("complete");
card.checklist("Something").items().each(function(item)
{
if(new RegExp("Start.*").test(item.name()))
item.remove();
});
Methods
(static) this.checklist()
Return the containing Checklist
- Source:
Example
card.checklist("Something").item("Blah").checklist().item("Blah");//AARRGH!
(static) this.id()
Return the id of this item
- Source:
Example
card.checklist("Something").item("Blah").id();
(static) this.isComplete()
Return true of this is complete
- Source:
Example
if(card.checklist("Something").items().first().isComplete())
card.postComment("The first item in the Something checklist is complete");
(static) this.linkedBoard()
Return a Board object that is linked in the name of this checklist item. If more than one board is linked, just returns the first one. Ignores any other text or formatting
- Source:
Example
card.checklist("Something").items().first().linkedBoard().name();
(static) this.linkedCard()
Return a Card object that is linked in the name of this checklist item. If more than one card is linked, just returns the first one. Ignores any other text or formatting
- Source:
Example
card.checklist("Something").items().first().linkedCard().name();
(static) this.markComplete()
Change the state of this item to complete
- Source:
Example
card.checklist("Something").items().first().markComplete();
(static) this.markIncomplete()
Change the state of this item to incomplete
- Source:
Example
card.checklist("Something").items().first().markIncomplete();
(static) this.name()
Return the name (ie. full text) for this item
- Source:
Example
card.checklist("Something").items().first().name();
(static) this.remove()
Remove this item from it's containing checklist and return the checklist
- Source:
Example
card.checklist("Something").item("Blah").remove();
(static) this.setName(name)
Set the text for this item (ie. it's name)
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the text to appear for the checklist item |
- Source:
Example
card.checklist("Something").items().first().setName("Blah");
(static) this.setPosition(pos)
Set the position for this item
Parameters:
Name | Type | Description |
---|---|---|
pos |
string | int | either top, bottom or a positive number |
- Source:
Example
card.checklist("Something").items().first().setPosition("top");