onData

Page

Registers a function to execute when the page received data from parent page.

$m.onData(function(eventObject) {

$m.toast("Received data from parent - " + eventobject.data);

});

Syntax

        $m.onData(fp_ondata)

Parameters

fp_ondata

function (required)

Function to execute when the page received data from parent page. The function receives an eventObject which contains the following property,

  1. result - {object/string/number/boolean}. Data passed from the parent page.

context

Object (optional)

Context in which the function should execute. If not provided, the function will be executed in window context.

Remarks

Refer open method to know about passing data to a child page.