PP.isBaseMemberOf

Syntax

isBaseMemberOf(cls: Function, memberName: String, checkOverride: Boolean);

Parameters

cls. Class instance.

memberName. Class member name.

checkOverride. Indicates if the specified member is redetermined in the parent class. Available Values:

Description

The isBaseMemberOf method returns whether the specified member is determined in one of the specified class's parents.

Comments

Available values:

Example

To execute the example, add a link to PP.js scenario file to HTML page in the <head> tag. Check if the setImageList, setWidth, hide and clone methods are determined for parents of the PP.Ui.Button class:

var checkMemberOf = function(className, memberName) {
    var isBaseMemberOf = PP.isBaseMemberOf(PP.getTypeByName(className), memberName, True);
    console.log("The %s%s member belongs to parent of the %s" class, memberName, (isBaseMemberOf ? "" : " not"), className);
};
checkMemberOf("PP.Ui.Button", "setImageList");
checkMemberOf("PP.Ui.Button", "setWidth");
checkMemberOf("PP.Ui.Button", "hide");
checkMemberOf("PP.Ui.Button", "clone");

After executing the example the browser console displays whether the setImageList, setWidth, hide and clone methods are determined for parents of the PP.Ui.Button class:

The setImageList member does not belong to parent of the PP.Ui.Button class

The setWidth member does not belong to parent of the PP.Ui.Button class

The hide member belongs to parent of the PP.Ui.Button class

The clone member belongs to parent of the PP.Ui.Button class

 

To check without taking into account redetermined members, set the checkOverride parameter to False:

var checkOverrideMemberOf = function(className, memberName) {
    var isBaseMemberOf = PP.isBaseMemberOf(PP.getTypeByName(className), memberName, false);
    console.log("The %s%s member belongs to parent of the %s class", memberName, (isBaseMemberOf ? "" : " not"), className);
};
checkOverrideMemberOf("PP.Ui.Button", "setImageList");
checkOverrideMemberOf("PP.Ui.Button", "setWidth");
checkOverrideMemberOf("PP.Ui.Button", "hide");
checkOverrideMemberOf("PP.Ui.Button", "clone");

After executing the example the browser console displays the value information that differs from the previous request: the setWidth method is redetermined in the PP.Ui.Button class and that is why it is marked as no belonging to parent in the first request:

The setImageList member does not belong to parent of the PP.Ui.Button class

The setWidth member belongs to parent of the PP.Ui.Button class

The hide member belongs to parent of the PP.Ui.Button class

The clone member belongs to parent of the PP.Ui.Button class

See also:

PP