property customAttributes

(r/o) int32 customAttributes;

Typ

Zugriff

This property returns a basics::dictionary containing all attributes and their associated values.

See the basics::dictionary section for more details.

function DetectCustomState(box)
{
    var params = box.customAttributes;
    var custLockedState = false;

    if (params)
    {
        var keyList = params.allKeys();
        var count   = keyList.count;
        for (var i = 0; i < count; ++i)
        {
            var key = keyList.getValue(i);
            if (key == "customLock")
            {
                var value = params.valueForKey(key);
                if (value == "on")
                    custLockedState = true;

                break;
            }
        }
    }

    return custLockedState;
}