Hi,
Iam using simpleresultstable module with pager to show results like below.
a link
View http://www.some url
View http://www.some url
View http://www.some url
Now in application.js i use this following code to show the value when clicked.
switch (Splunk.util.getCurrentView()) {
case "dd1":
if (Splunk.Module.NullModule) {
Splunk.Module.NullModule = $.klass(Splunk.Module.NullModule, {
getModifiedContext: function() {
var name = this.getContext().get("click.name");
var val = this.getContext().get("click.value");
if (name == "a") {
alert(val);
}
return context;
}
});
}
break;
}
when i click the table it shows only the first column value in message box.
I want to get the clicked value in MessageBox.
Thanks
Jquery, which is built into Splunk, could be used.
(the .live has been replaced with .on in the current version of Jquery, but Splunk is using version 1.6, so .live will work.
if (Splunk.util.getCurrentView() == 'your_view_name' ) {
$(".myButtonClass").live("click", function(event){
event.preventDefault();
var txt = $(this).text();
var url = $(this).url();
alert(txt);
alert(url);
});
}
What kind of drilldown are you using, row or all? You need to have drilldown set to all
in your SimpleResultsTable module and then use the variable click.value2
to get the contents of the specific cell that is clicked. click.value
just gives you the value of the first cell in the row clicked.
http://docs.splunk.com/Documentation/Splunk/5.0/AdvancedDev/TableChartDrilldown
No I am not using any drill down here.Iam using javascript code to get the value in message box.
I found there is a possibilty to get the clicked value in message box.
The above table shows a and link columns.Iam displaying that using simpleresultstable module.When i click any cell value(second column cell value) it loads application.js file and after executing the script it shows the first column cell value only.But I want to get the link value say that(http://someurl).