Advertisement
Guest User

ComboBox is not a constructor

a guest
Apr 25th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. define(["dojo/store/Memory","dojo/_base/declare","md/myownclass","dijit/form/ComboBox", "dojo/query", "dojo/keys", "dijit/Tooltip", "dojo/on","dojo/dom","dojo/dom-construct"],
  2. function(Memory,declare, myownclass, ComboBox, query, keys, Tooltip, on, dom, domConstruct){
  3.     return declare(null,{
  4.         MyMemory : null,
  5.         comboBox : null,
  6.         //keyhandle : null,
  7.         //oldval : "",
  8.         constructor: function(){
  9.             this.MyMemory = new myownclass();
  10.             var stateStore = new Memory({data : this.MyMemory.data});
  11.             comboBox = new ComboBox({
  12.                             id: "stateSelect",
  13.                             name: "state",
  14.                             value: "",
  15.                             store: stateStore,
  16.                         searchAttr: "name"
  17.                         }, "stateSelect");
  18.                 handle = on(dom.byId("stateSelect"),"keyup", this.keyupfoo);       
  19.             },
  20.     keyupfoo : function(pressed)
  21.         {
  22.             if(pressed.keyCode == keys.ENTER){
  23.                 var value = dijit.byId('stateSelect').get('value');
  24.                 var isNew = true;
  25.                 var d = MyMemory.getdata();
  26.                 for(var index = 0; index < d.length ; index++)
  27.                 {
  28.                     if(value == d[index])
  29.                     {
  30.                         isNew = false;
  31.                     }
  32.                 }
  33.                 if(isNew == true){
  34.                     MyMemory.setdata(value);
  35.                 }
  36.             }
  37.             if(pressed.keyCode == keys.NUMPAD_MINUS && pressed.keyCode.ctrlKey == true){
  38.                     MyMemory.deletedata(value);
  39.             }
  40.             if(pressed.keyCode == keys.NUMPAD_MULTIPLY && pressed.keyCode.ctrlKey == true){
  41.                 if(oldval == ""){
  42.                     oldval = value;
  43.                 }
  44.                 else{
  45.                     MyMemory.updatedata(value,oldval);
  46.                     oldval = "";
  47.                 }
  48.             }
  49.             if(pressed.keyCode == keys.F1){
  50.                 new Tooltip({
  51.                     connectId: ["stateSelect"],
  52.                     label: "CTRL+'-' will delete existing entry <br> Updating existing Entry please mark an Entry press CTRL+'*' and write a new Entry and repress CTRL+'*'!"
  53.                 });
  54.             }
  55.         }
  56.        
  57.     });
  58. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement