Adding/Deleting Rows in Data Grid messes up positioning

Drew shared this problem 4 years ago
Solved

**THE DEETS**: I am trying to build out an email system with inbox, sent, draft, and trash Screens as well as filters for starred and read. I first tried creating one Data Master and giving each email a "status" which I could use to filter. Unfortunately, any sort of filtering or modification of my data grid breaks the styling I use to differentiate between read/unread and starred/unstarred emails (see https://www.justinmind.com/community...).


**MY WORKAROUND:** I decided to make a Data Master for each Screen (inbox, sent, trash, draft) and simply add the row to one data master then delete it from another. For example, when deleting an email from the inbox, I:


1. "Set Value" of var emailSelected to [Row_1] of my Data Grid.


2. create a New row in the Trash Data Master:


NEW ['Subject= 'Select ['emailSelected', 'Subject'], 'EmailBody= 'Select ['emailSelected', 'Body'], ....etc. etc.


3. delete the row from Inbox Data Master:


DELETE[ Filter[ 'Inbox', [ 'EmailID = Select[ 'emailSelected', "EmailID' ] ] ] ]


I can now send emails to the trash from the inbox, and I use the same method to send emails back to the inbox from the trash (restore).


**PROBLEM:** if I trash X number of emails that are not at the bottom of the inbox, any emails subsequently restored to my inbox will appear correct until I click on them and it displays the info from the email that is X above the clicked email in the inbox. Oddly, none of the rows that were originally in the inbox are affected this way, even if they're below the email that is trashed. Same thing happens if done vice versa from trash to inbox.


Please help! Thank you.

Comments (4)

photo
1

I can't believe no one has come across this same issue. All I am trying to do is filter a data grid and then style certain items OR move rows around from one data master to another. They seem like simple functions. Aside from these issues, I would recommend Justinmind over Axure to my company. Instead, I will be recommending Axure unless I can solve these problems.

photo
1

Update: Although the mystery described above remains unsolved, I've solved the filtering/styling issue. See the fix here: https://www.justinmind.com/community....


I'm sure I will eventually want to move rows around from one Data Master to another, and I'll run into this mystery all over again. Anyone have ideas?

photo
1

Hi Drew,


instead of having multiple data masters, you could have one data master with an extra column that can have the different states you want (for example in which folder it is stored now)


Does this help in your simulation?


Best,


Marc

photo
1

As stated in the original post, I tried that first and it was not working so I was using this as a workaround. Since then, I've been able to make that method work, however, I think it'd behoove us to solve this little mystery now instead of waiting for it to come up again. Moving rows from one Data Master to another doesn't seem like an uncommon thing to want to do.


I am thinking there may be a row counter or something that is getting messed up because the Data Grid displays correctly, but I use [Row_1] to store the data and then display it on a details page (which then shows incorrect data).