AnsweredAssumed Answered

Issue with ComboBox in custom widget

Question asked by OsDiAl31 on Mar 27, 2019
Latest reply on Mar 27, 2019 by OsDiAl31

Good morning.

 

I'm stuck trying to do simple widget with a CombBox.

 

My HTML look like this:

 

<div>
    <div data-dojo-attach-point="selectTipo"></div>
</div>

 

My Widget.js is currently just this:

 

define(['dojo/_base/declare', 'jimu/BaseWidget', 'dijit/form/Select', 'dojo/data/ObjectStore', 'dojo/store/Memory', 'dojo/domReady!'],
  function(declare, BaseWidget) {
    return declare([BaseWidget], {
      baseClass: 'jimu-widget-widgetprueba',

      startup: function() {
       this.inherited(arguments);

       var store = new Memory({
                    data: [
                      { id: "foo", label: "Foo" },
                      { id: "bar", label: "Bar" }
                    ]
                 });

            var os = new ObjectStore({ objectStore: store });

            var s = new Select({
               store: os
            }, this.selectTipo);
            s.startup();
      }
    });
  });

 

But when I run this in the demo, I get this error.

 

ReferenceError: Memory is not defined

 

I have added the 'dojo/store/Memory', so I don't understand what the problem is!

 

Thanks for any help!

Outcomes