Hi chakkay,
1.First you have to make HTML web resource. Use jquery data table because it is provides you default search button for all bind column.
2.Use crm rest builder tool for getting data from crm.
3. Bind this data in jquery data table.
4. You have to put custom drop down for filter active or inactive and pass this filer in rest api filter.
I am sure it is really work for you.
Note : add jquery data table ref in your crm web resource and use in HTML web resource.
Please use this code for your reference.
<html><head>
<link href="xxxxxxxxxx.crm8.dynamics.com/.../zep_bootstrap.min.css" rel="stylesheet">
<link href="xxxxxxxxxx.crm8.dynamics.com/.../zep_jquery.dataTables.min.css" rel="stylesheet">
<link href="maxcdn.bootstrapcdn.com/.../font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
.inputtext {
height: 30px
}
.form-control {
font-size: 0.9rem !important;
}
th {
font-family: sans-serif,"Segoe\ UI\ Semibold",Tahoma;
font-size: 11px;
font-style: normal;
font-variant: normal;
font-weight: 700;
line-height: 20px;
}
td {
font-family: Arial,"Segoe\ UI",Tahoma;
font-size: 13px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
}
div {
font-family: Arial,"Segoe\ UI",Tahoma;
font-size: 13px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
}
.ddlCurrency option {
font-family: Arial,"Segoe\ UI",Tahoma !important;
font-size: 13px !important;
font-style: normal !important;
font-variant: normal !important;
font-weight: 400 !important;
line-height: 20px !important;
}
select.form-control:not([size]):not([multiple]) {
height: calc(1.90rem + 2px) !important;
}
#ddlCurrency select {
background: transparent !important;
width: 170px !important;
color: grey !important;
border: 0 !important;
border-radius: 0 !important;
height: 10px !important;
}
</style>
<meta><meta></head>
<body style="word-wrap: break-word;">
<button id="btnShow" class="btn btn-default btn-sm float-right" onclick="ShowData();"> <i class="fa fa-refresh"></i></button> <img src="zep_loading_icon" id="img" style="display:none" width="100px">
<table class="table table table-hover table-striped table-bordered compact">
<thead>
<tr>
<th>Column1</th>
<th>Column1</th>
<th>Column1</th>
<th>Column1</th>
<th>Column1</th>
<th>Column1</th>
<th>Column1</th>
<th>Column1</th>
</tr>
</thead>
<tbody></tbody>
<tfoot></tfoot>
</table>
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script src="xxxxxxxxxx.crm8.dynamics.com/.../zep_jquery-3.2.1.min.js"></script>
<script src="xxxxxxxxxx.crm8.dynamics.com/.../zep_jquery.dataTables.min.js"></script>
<script src="xxxxxxxxxx.crm8.dynamics.com/.../zep_moment.min.js"></script>
<script>
$(document).ready(function () {
$(".table").hide();
GetData();
});
function ShowData() {
GetData();
}
</script>
<script>
function GetData() {
$('#img').show();
//var ID = 897;
var ID = window.parent.Xrm.Page.getAttribute('xxxxxxxxxx_navcustomercode').getValue();
//Here you have to fetch data(Contact) from crm using rest api.
//first install rest builder in online crm
//fetch contact from crm
}
function bindData(data) {
$(".table").dataTable().fnDestroy();
var tbl = $('.table').DataTable(
{
"paging": true,
"autoWidth": false,
"searching": true,
"info": true,
"aaData": data,
"aoColumns": [
{
"sTitle": "Order Type", "mData": "OrderType", className: "dt-head-center dt-right"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Actual Rate", "mData": "ActualRate", className: "dt-head-center dt-right"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Execute Rate", "mData": "ExecutRate", className: "dt-head-center dt-right"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Virtual Currency", "mData": "VirtualCurrency", className: "dt-head-center dt-center"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Virtual Currency Amount", "mData": "VirtualCurrencyAmount", className: "dt-head-center dt-right"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Fiat Currency", "mData": "FiatCurrency", className: "dt-head-center dt-center"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Virtual Fees", "mData": "VirtualFees", className: "dt-head-center dt-right"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Fiat Fees", "mData": "FiatFees", className: "dt-head-center dt-right"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Invoice Number", "mData": "InvoiceNumber", className: "dt-head-center dt-left"
, "render": function (mData, type, full, meta) {
return mData;
}
},
{
"sTitle": "Created Date", "mData": "CreateDate", className: "dt-head-center dt-center"
, "render": function (mData, type, full, meta) {
return moment(mData).format('DD/MM/YYYY HH:mm:ss');
}
},
{
"sTitle": "Modified Date", "mData": "ModifyDate", className: "dt-head-center dt-center"
, "render": function (mData, type, full, meta) {
return moment(mData).format('DD/MM/YYYY HH:mm:ss');
}
}
]
});
}
</script>
</body></html>
Thanks,
keyur shah