1 Reply Latest reply on Sep 5, 2016 7:44 AM by Peter Kahrel

    type ahead in SCRIPTUI column list

    jakec88782761 Level 1

      Hi Guys,

       

      I have a termbase which I am creating and I'd like to add a function which allows users to type into the edittext field to search for items in col1.

      Here is my code for the columns and edittext field:

       

      var columns = w.add('group{multiselect:true}');
      columns.spacing=0;

      var dimC = [0,0,200,600];

      var col1 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Trans-tibial","Trans-femoral"]);
      var col2 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Transtibial","Transfémoral"]);        //French
      var col3 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Trans-tibial","Trans-femoral"]);      //German
      var col4 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Transtibiale","Transfemorale"]);     //Italian
      var col5 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Transtibial","Transfemoral"]);        //Spanish
      var col6 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Trans-tibial","Trans-femoral"]);      //Norwegian
      var col7 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Trans-tibial","Trans-femoral"]);      //Russian
      var col8 = columns.add('listbox', dimC, ["Dorsiflexion", "Plantarflexion","Trans-tibial","Trans-femoral"]);      //Turkish


      col1.selection=0;

       

      col1.onDoubleClick=function(){
          entry.text=col1.selection;
          };
      col2.onDoubleClick=function(){
          entry.text=col2.selection;
          };
      col3.onDoubleClick=function(){
          entry.text=col3.selection;
          };
      col4.onDoubleClick=function(){
          entry.text=col4.selection;
          };
      col5.onDoubleClick=function(){
          entry.text=col5.selection;
          };
      col6.onDoubleClick=function(){
          entry.text=col6.selection;
          };
      col7.onDoubleClick=function(){
          entry.text=col7.selection;
          };
      col8.onDoubleClick=function(){
          entry.text=col8.selection;
          };

       

      var user_input = w.add('group')
      var entry = user_input.add('edittext',dimH, 'Click the button to the right to convert to lowercase');
      entry.characters=30;
      entry.alignment='left';
      entry.active=true;

       

        
        

      var convert = user_input.add('button', undefined, 'Convert to lower case');
      convert.onClick=function() {entry.text=entry.text.toLowerCase();}
      user_input.orientation='row';
      user_input.alignment='left';

       

      Everyone on here is so helpful.

       

      Thanks,

       

      Jake