Web Add-in Extensibility Developer Guide > JavaScript Function Reference > Identification and Filter Functions > Identification Function per Toolkit

Identification Function per Toolkit      


Returns the test object class name of the custom control.


function <get class name>()

Return Value

If an element is the root of the custom control, returns the test object class name. Otherwise, returns null.


This example shows a function that handles all custom controls for a toolkit.

From the toolkit configuration file:


    <CommonIdentification type="javascript"

        file_name="MyControls.js" function="ControlFromElement"/>



From MyControls.js:

function ControlFromElement()


    if !(_elem.className) return null;

    var clName = _elem.className;


    if (clName.indexOf('myToolKit-Calendar')

        {return "myToolKit-Calendar";}


    if (clName.indexOf("myToolKit-Spinner")

        {return "myToolKit-Spinner";}




    return null;