RECOMMENDATION: If you are using a version of The Portal Connector higher than 4.0, we strongly recommend utilizing the MVC based widgets and components to create your site. This documentation is for legacy purposes only and will soon be deprecated.

enable()

Enable the widget on the page.

Parameters

None

Returns

None

get_type()

Returns the widget type

Parameters

None

Returns

String

clear()

clear the value of the widget

Parameters

None

Returns

None

disable()

disable the widget on the page.

Parameters

None

Returns

None

add_valueChanged()

Fired when the value of the widget is changed by the user.

The event handler function context (Available via the this keyword) will be set to the widget instance.

Example-Status Add Value Changed Binding

//For example, using: var a = tpc.forms[0].TpcStatus.add_valueChanged(function() { console.log( this.get_value()); }); //will output the selected value of the widget to the console as soon as the value changes. All delegates must be set with a variable.
Parameters

Function

Returns

None     

get_container()

Returns the container element of the widget.     

Example-Status Fetch Container Element

tpc.forms[0].TpcStatus.get_container();
Parameters

None

Returns

JQuery Object     

get_element()

Returns the element of the widget.

Example-Status Fetch Element

tpc.forms[0].TpcStatus.get_element();
Parameters

None

Returns

JQuery Object

get_fetchValue()

Returns the value of the widget that is compatible with FetchXML filtering.

Example-Status Fetch Fetch Value

tpc.forms[0].TpcStatus.get_fetchValue();
Parameters

None

Returns

String

get_input()

Returns the input element of the widget.

Example-Status Fetch Input Element

tpc.forms[0].TpcStatus.get_input();
Parameters

None

Returns

JQuery Object

get_selectedText()

Returns the text label of the selected value of the widget.

Example-Status Fetch Selected Text

tpc.forms[0].TpcStatus.get_selectedText();
Parameters

None

Returns

String

get_value()

Returns the value of the widget.

Example-Status Fetch Value

tpc.forms[0].TpcStatus.get_value();
Parameters

None

Returns

String

set_selectedText()

Sets the value of the widget by its text label.

Example-Status Set Selected Text

tpc.forms[0].TpcStatus.set_selectedText("Active"); tpc.forms[0].TpcStatus.set_selectedText("​Inactive");
Parameters

String

Returns

None

set_value()

Sets the value of the widget.

Example-Status Set Value

tpc.forms[0].TpcStatus.set_value("0;1"); tpc.forms[0].TpcStatus.set_value("1;2");
Parameters

String

Returns

None

hide()

Hides the widget from the form.

Example-Hide Status

tpc.forms[0].TpcStatus.hide();
Parameters

None

Returns

None

show()

Shows the widget on the form.

Example-Show Status

tpc.forms[0].TpcStatus.show();
Parameters

None

Returns

None

get_model()

Returns the model object ​of the widget, which contains a number of useful properties related to the widget.

In the case of the CRM ​Status widget, these returned properties and their types are:

  • IsHidden: Boolean
  • LabelPosition: Integer
  • Options: Array
  • ReadOnly: Boolean

Example-Status Fetch Model

tpc.forms[0].TpcStatus.get_model();
Parameters

None

Returns

Object

remove_valueChanged()

Removes any delegate hooked up to the add_valueChanged() event.     

Example-Status Remove Value Changed Binding

//For example, using: var a = tpc.forms[0].TpcStatus.add_valueChanged(function() { console.log( this.get_value()); }); //will output the selected value of the widget to the console as soon as the value changes. All delegates must be set with a variable. This way you can easily remove this delegate from any widget by using: tpc.forms[0].TpcStatus.remove_valueChanged(a);
Parameters

Function

Returns

None     

toggle()

toggles the visibility of the widget. ​

Example-EXAMPLE-STATUSFIELD TOGGLE

tpc.forms[0].TpcStatusField.toggle()
Parameters

None

Returns

None

readonly()

 set the widget state to read only

Example-Status Field- READONLY

//set to true
tpc.forms[0].TpcStatusField.readonly(true);

//set to false
tpc.forms[0].TpcStatusField.readonly(false);

//show the read only status
tpc.forms[0].TpcStatusField.readonly();
Parameters

true, false

Returns

None