TypedInput with fix value list and "msg" option

Hi,

I need a TypedInput with a fix valuelist in default. But I would like to give the alternativ option to set the value by the msg object.

I need help by the implementation.

    <div class="form-row">
        <label for="node-input-direction" style="width: 130px;"><i class="fa fa-tag"></i> <span>direction</span></label>
        <input type="text" id="node-input-direction">
        <input type="hidden" id="node-input-directionType"></input>
    </div>
     defaults: {
        name: { value: "" },
        direction: { value: "input" },
        directionType: { value: "str", options:["input","output"] }
    },
    oneditprepare: function () {
        var node = this;

        $("#node-input-direction").typedInput({
            default: 'str',
            types: ["str", "msg"],
            typeField: $("#node-input-directionType")
        })
    }

My source code does not deliver the desired result.
What can I do to get by default a value list like the boolean type and the msg option as alternativ?

Where you specify types you need to use an object instead of 'str'. See the types example here ...

3 Likes

Thank you very much for the solution of my problem.

It would be nice if the example of GitHub can be included in the documentation (@knolleary) . In this way it would be easier to work in the TypeDefinition.

(hint) - we accept pull request for docs as well as code