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()

Enables the widget on the page.

Example-Enable Status Field

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

None

Returns

None

get_type()

Returns the widget type.

Example-Status Field Fetch Type

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

None

Returns

String

clear()

Clears the value of the widget.

Example-Clear Status Field

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

None

Returns

None

disable()

Disables the widget on the page.

Example-Disable Status Field

tpc.forms[0].TpcStatus.disable();
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 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 delegates 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-STATUS 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