This is a strange request i know, but there is method behind the madness. As we want to know the position of the “record” on the page hence using the $index from the repeat. Was it the 1st or 5th record.
So we have a repeat with data. The $index is created from the repeat. Then we have a modal that opens. And we use the Data Detail (* with ID) to get all the information… eg… id… name … and that works 100%. But how to we pass the $index value to the modal from the repeat? is this possible?
Thanks for the replay Teodor. I am using the ID for the detail. And getting all the correct information of the record in the modal. That is all working 100%. But what i want to achieve is… using the $index value from the repeat so also be send to the modal so that we can record the position of that record in the table…eg was it 1st or 5th. As we using a page query and would like to know the position of the record… as some might be deleted later… but the the position changes because of the $index. so i guess is it possible to pass any other variable to the model on click…
I see
So just add a variable inside the modal, and on the same onclick event you are opening the modal and setting the record ID to the data detail set a value for this variable inside the modal picking $index as a value for it. Then you can use this variable value wherever you need.