Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82381

Set Tags Default Value?

$
0
0

Using Editor 2.4.1, I am attempting to set a default value for the tags. My initial attempt was to simply use the option def as below:

{ label: "Branch Size", name: "Branches.BranchSize_Id", type: "tags", multiple: false, def: modelID  }

This results in the field simply stuck on the processing icon, and not displaying the value:

So I figured maybe def isn't supported, and attempted the following code to set the value using the initCreate event as below:

  editor.on("initCreate", function () {
    this.set("Branches.BranchSize_Id", modelID);
    console.log(editor.field("Branches.BranchSize_Id").val());
});

However, this results in the same behavior.

Interestingly if I write the value of the field in either situation...it appears that it did set and returns the value. It just doesn't seem to update the display.

Backend code for the options is simple enough, and the value being set is a valid value in the list:

                        editor.Field(
                            new Field("Branches.BranchSize_Id").Options(
                                new Options().Table("BranchSizes")
                                    .Value("Id")
                                    .Label("Name")
                                    .Where(q => q.Where("InactiveDate", null)).
                        Order(false)).
                        SetFormatter(Format.NullEmpty()))
                        ;

Thanks for your assistance :smile:


Viewing all articles
Browse latest Browse all 82381

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>