Transfer variable to a pop-up window from clicking a tile in a data grid to show data of the same
Hello.
I have a data grid functioning as an item display or "tiles". I have an event that when one is clicked a window show up. I want this pop-up to display data of the same tile clicked, I.e. the image, name, description, etc.
What will be the best way to achieve this?
There are two methods to accomplish this, that I know of. The first method is to create an event based on the click of a data grid record using a hotspot that copies the values from the data grid record to the pop-up modal then shows the modal, which is initially hidden. The second way is to add an "id" column to your data master and include it as a hidden field in the data grid record. Then, using the same type of hotspot click event, use the id to filter the data master for each of the fields of the record you want to populate in the pop-up modal before showing the hidden modal. I have included screenshots below of example actions and expressions used for implementing these two methods. I don't know if one would be preferable to the other for performance or any other reasons.
I have attached a prototype that demonstrates both methods using two hotspots per record. Clicking on the left half of a record populates the pop-up modal using the first method while clicking on the right half of a record populates the pop-up modal using the second method. By clicking each half in succession, you will see that the same results are returned. You will have to drill down into the implementation to confirm that the pop-up modal is indeed being populated by two different methods.
To use the prototype, simply change the extension from ".rar" to ".vp". The file is not compressed. As for user images in the data master records of the prototype, since this field is a file upload type, you will need to supply these yourself if you care to see images with the records, but they should function the same as any other field in the record.
Hope this helps. Cheers!
First method example action with expression. The "selected_user_first_name_value" field in the pop-up modal is populated by copying it from the "user_first_name_value" in the selected data record of the data grid.:
Second method example action with expression. The "selected_user_first_name_value" field in the pop-up modal is populated by copying the hidden "user_data_master_data_record_id" from the selected data record of the data grid and using it to filter the "users_data_master" for the correct record, then selecting the value of the matching record's "first_name" field.:
There are two methods to accomplish this, that I know of. The first method is to create an event based on the click of a data grid record using a hotspot that copies the values from the data grid record to the pop-up modal then shows the modal, which is initially hidden. The second way is to add an "id" column to your data master and include it as a hidden field in the data grid record. Then, using the same type of hotspot click event, use the id to filter the data master for each of the fields of the record you want to populate in the pop-up modal before showing the hidden modal. I have included screenshots below of example actions and expressions used for implementing these two methods. I don't know if one would be preferable to the other for performance or any other reasons.
I have attached a prototype that demonstrates both methods using two hotspots per record. Clicking on the left half of a record populates the pop-up modal using the first method while clicking on the right half of a record populates the pop-up modal using the second method. By clicking each half in succession, you will see that the same results are returned. You will have to drill down into the implementation to confirm that the pop-up modal is indeed being populated by two different methods.
To use the prototype, simply change the extension from ".rar" to ".vp". The file is not compressed. As for user images in the data master records of the prototype, since this field is a file upload type, you will need to supply these yourself if you care to see images with the records, but they should function the same as any other field in the record.
Hope this helps. Cheers!
First method example action with expression. The "selected_user_first_name_value" field in the pop-up modal is populated by copying it from the "user_first_name_value" in the selected data record of the data grid.:
Second method example action with expression. The "selected_user_first_name_value" field in the pop-up modal is populated by copying the hidden "user_data_master_data_record_id" from the selected data record of the data grid and using it to filter the "users_data_master" for the correct record, then selecting the value of the matching record's "first_name" field.:
Thank you for your contribution eggroll!
Thank you for your contribution eggroll!
Replies have been locked on this page!