CSBL - widgetKnob (IN/OUT)

×

Warning message

You can't delete this newsletter because it has not been sent to all its subscribers.

 

6.9.1 widgetKnob as Writing widget

First of all, an existing widget must be identified in the dashboard to be the target of the triggered action, of which the id <TARGET_WIDGET_NAME> must be noted. In this example the target is a WidgetSingleContent.

The JavaScript function to be inserted in the appropriate box (in more options) of the current widgetKnob is of the following type:

function execute() {   
     $('body').trigger({
        type: "showSingleContentFromExternalContent_<TARGET_WIDGET_NAME>",
        eventGenerator: $(this),
        targetWidget: "<TARGET_WIDGET_NAME>",
        color1: "#e8a023",
        color2: "#9c6b17",
        widgetTitle: "ShowKnobStatus", 
passedData: { "dataOperation": param }
    });
}

The param variable consists of the input value generated by the widgetKnob widget state change. you can send it in passedData, or use it to perform operations in javascript:

The passedData field can be:

       passedData: {
             "dataOperation": param
}

 

6.9.2 widgetKnob as Reading widget

It is possible to send a numeric value from another widget as a read parameter in the widget knob using a JavaScript function inserted in the CKEditor of the writing widget.

In this example, you can send a parameter from an impulse button widget to a knob widget. In the CKEditor of the writing widget this excute function must be written whose type must be written as follows. showKnobFromExternalContent_<TARGET_WIDGET_NAME>

function execute() {   
$('body').trigger({
    type: "showKnobFromExternalContent_w__1540_widgetKnob10040",
    eventGenerator: $(this),
    targetWidget: "w__1540_widgetKnob10040",
    color1: "#e8a023",
    color2: "#9c6b17",
    widgetTitle: "ShowData", 
    passedData: { "dataOperation": <VALUE>}
    });
}

The passedData field can be:

passedData: {
      "dataOperation": <VALUE>
}