javascript - How to display a value in a textfield on click of "done" button in picker field in sencha touch? -


i trying display selected text of picker field in textfield in sencha touch 2.1. can't see wrong in code still not working. below code. please provide working solution.

{     xtype : 'textfield ',     id : 'pacingmode ',     style : 'background - color: #585858;',     top : '13.5%',     usepicker : true,     left : '20%',                                                                                  width : '5%',                                                                              listeners : {           'focus' : function(a,e, eopts) {                                                                                                                                              console.log("show caling");                 document.activeelement.blur();                 if (!this.picker) {                 this.picker = ext.viewport.add({      xtype: 'picker',     id: 'pacingmodepickerfield',     usetitles: true,     slots: [{             name: 'quantity',             title: 'pacing mode',             data: modelmgr.slotsdata1,             valuefield: 'value',         }     ],     donebutton: {         listeners: {             // when done button tapped, set value             tap: function (button, event, eopts) {                  var sel = document.getelementbyid("pacingmodepickerfield");                 var text_value = sel.options[sel.selectedindex].text;                 ext.getcmp('pacingmode').setvalue(text_value);              }         }     }  });  } this.picker.show(); }, change: function (a, e, newvalue, eopts) {     sendvaluesetrequest(this.id);  }, } 

you should use framework value picker:

tap: function(button, event, eopts) {           var val = ext.getcmp("pacingmodepickerfield").getvalues().quantity;                                                                                                                                                                                                                                                           ext.getcmp('pacingmode').setvalue(val);                                                                                                                          } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -