This routine uses the Data Search Resources that are defined for Block Products. This procedure allows multiple block fields to act as Search Sources to feed other Blocks. Please follow these steps:
- Add an ‘attribute’ command with the following parameters:
- data-dataid="number" where number is the DataID of the resource. It can be found by selecting Options/Search Resources from any Block Product top menu.
- data-search="Column Header Name 1:Block Name 1, Column Header Name 2:Block Name 2". Please note that the Column headers or Block names must not contain a colon : or a comma. The comma is the fields separator whereas the colon is the header – value separator. More fields can be added as needed.
- data-clear="true" optional to clear search box after searching.
- Add a button to activate the search. This can be done in a number of ways, the easiest would be using the ‘postfix’ command:
- Add a ‘status’ command to limit the width of the search block control, example: noprint controlwidth=300
- Add a ‘postfix’ command to display a button using an ‘a’ link tag with an onclick event equals to SearchAndApply('Search Block Name'). Example: ^<a href="javascript:;" class="btn btn-sm btn-primary" title="Click to Search" onclick="SearchAndApply('Search DEA')"><i class="fa fa-search"></i></a>
- An alternative method to using postfix is the new commands htmlbefore and htmlafter.
Example 1 using postfix:
Command: attribute
Value:
data-dataid="122" data-search="first_name:FirstName,last_name:LastName"
Command: status
Value: noprint controlwidth=300
Command: postfix
Value:
^<a href="javascript:;" class="btn btn-sm btn-primary" title="Click to Search" onclick="SearchAndApply('Search DEA')"><i class="fa fa-search"></i></a>
Example 2 using htmlbefore and htmlafter:
Command: attribute
Value:
data-dataid="122" data-search="first_name:FirstName,last_name:LastName" data-clear="true"
Command: status
Value: noprint
Command: htmlbefore
Value:
<div class="row">
<div class="col-sm-10">
Value:
</div>
<div class="col-sm-2t">
<a href="javascript:;" class="btn btn-sm btn-primary" title="Click to Search" onclick="SearchAndApply('Search DEA')"><i class="fa fa-search"></i></a>
</div>
</div>
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article