Namespace: Response

TDI.Ajax. Response

The Response API for the TDI AJAX. Provides a set of custom tdi events which can be used to control or to react to the TDI responses.

Events


tdi:ajax:beforeInsert

Fires before the TDI insert takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onInsertDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
target_id String

The ID of the insert target

selector String

CSS selector for multiple targets

target jQuery

The insert target

content String

The insert contents

position String

The position of the insert (before|after)

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforePopup

Fires before the TDI popup takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onPopupDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
href String

The URL of the popup

mode String

The mode of the popup (popup|dialog)

width Number

Width of the popup. Available only for dialog mode

height Number

Height of the popup. Available only for dialog mode

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforeRedirect

Fires before the TDI redirect takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onRedirectDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
href String

The URL to redirect to

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforeReload

Fires before the TDI reload takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onReloadDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforeScript

Fires before the TDI script takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onScriptDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
script_src String

Path to the external Javascript file

script_data String

Inline Javascript code

script_id String

ID of the <script> tag

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforeStyle

Fires before the TDI style takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onStyleDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
style_src String

Path to the external CSS file

style_id String

ID of the <link> tag

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforeUnknown

Fires before the TDI instruction takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onUnknownDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
contents String

Instruction contents

ATTRS_NAME String

Other attributes

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:beforeUpdate

Fires before the TDI update takes place.

This event is preventable. Use preventDefault() to prevent the default action (Response._onUpdateDefault).

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
target_id String

The ID of the update target

selector String

CSS selector for multiple targets

target jQuery

The update target

content String

The update contents

content_empty Boolean

Indicates whether the contents are empty

replace Boolean

Indicates whether the contents will replace the whole target

append Boolean

Indicates whether the contents will be appended to the end of the target

prepend Boolean

Indicates whether the contents will be prepended to the beginning of the target

class_add String

Space separated list of class names to add

class_remove String

Space separated list of class names to remove

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:done

Fires when all TDI actions are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
responses Array

The list of all instructions

options Object

Additional request options


tdi:ajax:insert

Fires after the TDI insert takes place.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
target_id String

The ID of the insert target

selector String

CSS selector for multiple targets

target jQuery

The insert target

content String

The insert contents

position String

The position of the insert (before|after)

inserted_node jQuery

Reference to the inserted HTML node

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:insertsDone

Fires when all TDI <insert>s are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
inserts Array

The list of all inserts

options Object

Additional request options


tdi:ajax:popup

Fires after the TDI popup takes place.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
href String

The URL of the popup

mode String

The mode of the popup (popup|dialog)

width Number

Width of the popup. Available only for dialog mode

height Number

Height of the popup. Available only for dialog mode

popup Window

Reference to the opened window

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:popupsDone

Fires when all TDI <popup>s are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
popups Array

The list of all popups

options Object

Additional request options


tdi:ajax:script

Fires after the TDI script takes place.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
script_src String

Path to the external Javascript file

script_data String

Inline Javascript code

script_id String

ID of the <script> tag

script_node jQuery

Reference to the inserted <script>

script_node_inline jQuery

Reference to the inserted inline <script>

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:scriptsDone

Fires when all TDI <script>s are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
scripts Array

The list of all scripts

options Object

Additional request options


tdi:ajax:style

Fires after the TDI style takes place.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
style_src String

Path to the external CSS file

style_id String

ID of the <link> tag

style_node jQuery

Reference to the inserted <link> node

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:stylesDone

Fires when all TDI <style>s are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
styles Array

The list of all styles

options Object

Additional request options


tdi:ajax:unknown

Fires after the TDI unknown instruction takes place.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
contents String

Instruction contents

ATTRS_NAME String

Other attributes

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:unknownsDone

Fires when all <unknown> TDI instructions are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
instructions Array

The list of all unknown instructions

options Object

Additional request options


tdi:ajax:update

Fires after the TDI update takes place.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
target_id String

The ID of the update target

selector String

CSS selector for multiple targets

target jQuery

The update target

content String

The update contents

content_empty Boolean

Indicates whether the contents are empty

replace Boolean

Indicates whether the contents will replace the whole target

append Boolean

Indicates whether the contents will be appended to the end of the target

prepend Boolean

Indicates whether the contents will be prepended to the beginning of the target

class_add String

Space separated list of class names to add

class_remove String

Space separated list of class names to remove

options Object

Additional request options

tag jQuery

The raw XML tag of the instruction


tdi:ajax:updatesDone

Fires when all TDI <update>s are done.

Parameters:
Name Type Description
evt Event

The event object

data Object

The event properties

Properties:
Name Type Description
updates Array

The list of all updates

options Object

Additional request options