Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Rav3
New Contributor

Mashups Clear funtion

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

2 Replies
erik_wetterberg
Valued Contributor III

Re: Mashups Clear funtion

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

Erik Wetterberg
https://extendingqlik.upper88.com/
nvrphanikumar
New Contributor III

Re: Mashups Clear funtion

Thank you!, Was searching for an answer and came across this