Class: CheckItem

TrelloEntities.CheckItem(data)

The CheckItem class represents a checklist item in Trello.

You will typically only interact with this class as a return value in an IterableCollection from a checklist.

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.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");