Select to view content in your preferred language

Default attribute value to the field of SmartEditor widget

708
3
Jump to solution
09-12-2018 07:03 AM
TokarAndrii
Occasional Contributor

How can i set a default attribute value to the field of SmartEditor widget as shown on picture

0 Kudos
1 Solution

Accepted Solutions
TokarAndrii
Occasional Contributor

question solved, I put my stuff to onOpne function of widget

onOpen: function () {
    if (this._userHasPrivilege === true) {
        //this.fetchDataByName('GroupFilter');
        this._workBeforeCreate();
        this.widgetManager.activateWidget(this);
    }
    if (this.templatePicker) {
        this.templatePicker.update();
    }

    setTimeout(function () {
        var query = document.getElementById("dijit_form_ValidationTextBox_0");
        query.setAttribute('value', '{00000000-0000-0000-0000-000000000000}')
    }, 300);

},

View solution in original post

0 Kudos
3 Replies
TokarAndrii
Occasional Contributor

I have tried such 

_setPresetValue: function () {
    var sw = registry.byId("savePresetValueSwitch");
    this._usePresetValues = sw.checked;

    query('#dijit_form_ValidationTextBox_0').forEach(function(node){

            setTimeout(function(){
                var widget = registry.byNode(node.children[0]);
                widget.set('value', 1);
            }, 300);

},

but i received an error
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Can you share a screenshot of the error?

0 Kudos
TokarAndrii
Occasional Contributor

question solved, I put my stuff to onOpne function of widget

onOpen: function () {
    if (this._userHasPrivilege === true) {
        //this.fetchDataByName('GroupFilter');
        this._workBeforeCreate();
        this.widgetManager.activateWidget(this);
    }
    if (this.templatePicker) {
        this.templatePicker.update();
    }

    setTimeout(function () {
        var query = document.getElementById("dijit_form_ValidationTextBox_0");
        query.setAttribute('value', '{00000000-0000-0000-0000-000000000000}')
    }, 300);

},
0 Kudos