Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"],
- function(Memory,declare, myownclass, ComboBox, query, keys, Tooltip, on, dom, domConstruct){
- return declare(null,{
- MyMemory : null,
- comboBox : null,
- //keyhandle : null,
- //oldval : "",
- constructor: function(){
- this.MyMemory = new myownclass();
- var stateStore = new Memory({data : this.MyMemory.data});
- comboBox = new ComboBox({
- id: "stateSelect",
- name: "state",
- value: "",
- store: stateStore,
- searchAttr: "name"
- }, "stateSelect");
- handle = on(dom.byId("stateSelect"),"keyup", this.keyupfoo);
- },
- keyupfoo : function(pressed)
- {
- if(pressed.keyCode == keys.ENTER){
- var value = dijit.byId('stateSelect').get('value');
- var isNew = true;
- var d = MyMemory.getdata();
- for(var index = 0; index < d.length ; index++)
- {
- if(value == d[index])
- {
- isNew = false;
- }
- }
- if(isNew == true){
- MyMemory.setdata(value);
- }
- }
- if(pressed.keyCode == keys.NUMPAD_MINUS && pressed.keyCode.ctrlKey == true){
- MyMemory.deletedata(value);
- }
- if(pressed.keyCode == keys.NUMPAD_MULTIPLY && pressed.keyCode.ctrlKey == true){
- if(oldval == ""){
- oldval = value;
- }
- else{
- MyMemory.updatedata(value,oldval);
- oldval = "";
- }
- }
- if(pressed.keyCode == keys.F1){
- new Tooltip({
- connectId: ["stateSelect"],
- label: "CTRL+'-' will delete existing entry <br> Updating existing Entry please mark an Entry press CTRL+'*' and write a new Entry and repress CTRL+'*'!"
- });
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement