- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 03:38 AM
Hi Team,
I have created a dashboard and reports on the user table and I want to add interactive filters for the name field on the user table but there is no interactive field for the string type field.
I need to create a custom interactive filter for the name field on the user table so we can search any record from the user name.
I want to include the condition active is true
I am not sure how to write code can someone help me?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 07:03 AM
Add Following code:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div class="row" style="margin-left:10px; margin-right:10px">
<div class="col-md-3" style='width:330px'>
<p style="font-size:15px"><b>User Name</b></p>
<input id='user_name' type = "text" onchange='filterUser()' ></input>
</div>
</div>
<script>
var dbh = new DashboardMessageHandler("filter_tasktype");
function filterUser(){
var userName = $j('#user_name').val();
var filter_message = {};
filter_message.id = "taskFilter"
filter_message.table = "sys_user"
if ((userName != '' )) {
filter_message.filter = "nameLIKE"+userName;
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
dbh.publishFilter(filter_message.table, filter_message.filter);
}
else {
filter_message.filter = "";
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
dbh.removeFilter();
}
}
</script>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 08:05 AM
Thanks @Unique45
Thank u for solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 08:11 AM
Hi @Unique45,
Thank u for the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 08:29 AM
Welcome! 😊
I would appreciate, if you give helpful 👍 as well to my solutions.