Refresh DataGrid with new info

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ThomasFireheart
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 48
Joined: Sat May 24, 2008 2:27 pm
Location: Indiana, USA

Refresh DataGrid with new info

Post by ThomasFireheart » Tue Mar 03, 2015 1:01 am

I have a DataGrid that gets populated by a few commands in openCard. When a user clicks an entry the mouseUp handler runs. Near the end of the mouseUp I need to refresh the data (which most likely changed from the openCard) and have the DataGrid show the latest data. All of my attempts to 'set the dgdata...' from within the mouseUp have failed to refresh the template/data of the DataGrid. Does anyone have any words of wisdom or can point me in the right direction ?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Refresh DataGrid with new info

Post by dunbarx » Tue Mar 03, 2015 2:18 am

Hi.

Try:

Code: Select all

dispatch "resetList" to group "yourDG"
Craig Newman

ThomasFireheart
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 48
Joined: Sat May 24, 2008 2:27 pm
Location: Indiana, USA

Re: Refresh DataGrid with new info

Post by ThomasFireheart » Tue Mar 03, 2015 3:31 am

Doesn't seem to do anything. Imagine a DataGrid with a row template having a label. The first row label has content of 1. The second 2 - and so on. As soon as you mouseDown on a row the contents of each row in the DataGrid would be multiplied by the content of the field you clicked on. This could repeat as many times as you want. When you click on the second row, how can the mouseDown change the contents of the other rows. Does that make sense ?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Refresh DataGrid with new info

Post by dunbarx » Tue Mar 03, 2015 4:13 am

Oh.

I do all my data stuff in the clear. That is, I extract the entirety of the DG contents either with the "dgData" or the "dgText", crunch whatever I need to, and then restore.

Sounds cumbersome, but straightforward.

It is certainly possible to deal with the DG directly, setting the contents by row or index, but I am lazy that way.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”