1 Reply Latest reply: Jun 1, 2017 7:02 AM by Erik Wetterberg RSS

    Mashups Clear funtion

    Raveendra Kumar Maguluri

      i am new to Mashups, want to clear selected field

      How can We write Html for this Below Java script.

       

      var config = {

      host: window.location.hostname,

      prefix: prefix,

      port: window.location.port,

      isSecure: window.location.protocol === "https:"

      };

      require(["js/qlik"], function(qlik) {

      // open the app

      var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);

      //get a field reference and clear the field selection var lastNameField = app.field('LastName'); lastNameField.clear(); });

       

      Thanks,

      Ravi

        • Re: Mashups Clear funtion
          Erik Wetterberg

          Hi,

          If you want to create a button the user can click to clear this field you could do something like this:

           

          <button type="button" id="clrfld" class="btn btn-primary">Clear field</button>
          

           

          And then in your javascript:

          var app = openApp(......);
          
          $( '#clrfld' ).click( function () {
            app.field('LastName').clear();
          } );
          

           

          Hope this helps

           

          Erik Wetterberg