Dashboards & Visualizations

Search Manager Javascript

Path Finder

When I convert my simple XML files with form inputs to HTML Dashboard
Suppose I am having a text input in my simple xml while converting to HTML Dashboard, Javascript with following code is generated in my HTML Dashboard.
var field2 = new TextInput({
"id": "field2",
"value": "$form.Direction$",
"default":"*",
"el": $('#field2')
}, {tokens: true}).render();
In the above code, I need a description on the following statement ( like what is the purpose of the statement)
"el": $('#field2')

0 Karma

SplunkTrust
SplunkTrust

$('#field2') is JQuery for "grab the HTML element with id='field2'", and whatever is returned is passed into the TextInput' constructor as the el property, short for "element".

In other words, that tells the TextInput to render itself within the HTML element with id="field2".