Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By mmilad200
#822407
Hello masters 8)
I want to filter a column based on an input field(TextBox Or DropBox )
Something like an Excel filter
The user enters the value in the search and then the values in the column are filtered based on that value
In fact, a kind of search in the grid list
Preferably based on javascript to be real time
How to do it؟
User avatar
By amosbatto
#822417
Are you a programmer? If so, you can use DataTables in a panel.

If you need to edit the data in the grid, DataTables charges for its Editor version. I haven't tried it, but Backgrid.js allows editing and it is open source.

Here are the basic steps:
1. Create a trigger that uses executeQuery() to query a database table to get the data and place it in an array. Then use json_encode() to convert that array into a JSON string and store that string in a variable associated with a hidden field in your Dynaform.

2. Add JavaScript to your Dynaform to get grid's data from the hidden field when the form loads and then use DataTables or Backgrid to place the grid inside a panel in your Dynaform.

3. If the grid's data can be edited by the user, then the grid needs to contain a primary key field with unique values so that you know which row got changed. Add JavaScript to the Dynaform which gets the contents of the grid when the Dynaform is submitted and uses JSON.stringify() to convert the contents of the grid into a JSON string to store in the hidden field.
Then create a trigger which is executed after the Dynaform, which uses json_decode() to convert the JSON string into an array. Then use executeQuery("UPDATE...") or executeQuery("INSERT...") to write each row from the grid to the database table.

If you don't want to get the grid's data from a database table, then you can store its data in a string variable in ProcessMaker. The steps would be similar.


If I can find the time, I will create an example, but you need to answer some questions:
1. Is the data from a database table or does the user manually enter all the data in the grid?
2. Is the data editable or read-only?
3. If the data is from a database table and the data is editable, should the changes in the data be written to the database table?
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]