hWorkUnitRender

Render a work unit as HTML for a given context.

You probably shouldn’t use this hook directly. Use the default implementation provided by the JavaScript Plugin object. See Workflow for details.

If you implement this hook directly, you should test the WorkUnit’s workType property, and if it matches a work unit you implement, generate the HTML.

The values for context are documented in the context property of the PluginWorkUnitRenderer interface.

Arguments

Name Type Description
workUnit WorkUnit The work unit to render
context String Where the unit is being rendered

Response

Return information by changing these properties of the response object.

Name Type Description
html String The HTML to output for this work unit in the given context

JavaScript template


P.hook('hWorkUnitRender', function(response, workUnit, context) {
    // Respond to hook, for example
    // response.html = ...
});