Hi,
I hope someone can help. I have set up a data grid to store some arrays to do with graphics cards as follows:
-----------------------------------
// allow access to global arrays and variables set up in main card.
global arrayProductName
global arrayProductRam
global arrayProductClockSpeed
global arrayProductCost
global MaxVidCards
// set up local variables
local theVideoCardInfo
local CardCount
// When mouse up event is detected on this button then execute following,
on mouseUp
// zero number of video cards found
put 0 into CardCount
// clear text showing number of video cards found
put empty into field "TotalCardsFound"
// clear search type heading
put empty into field "SearchTypeHeading"
// display search type heading
put "Search: All Video Cards" into field "SearchTypeHeading"
// display all video cards
repeat with loop = 1 to MaxVidCards
// increment number of video cards displayed. This is also used to determine which line
// video card details appear within data grid.
add 1 to CardCount
// copy video card data from array to data grid
put arrayProductName[Loop] into theVideoCardInfo[CardCount]["name"]
put arrayProductRam[Loop] into theVideoCardInfo[CardCount]["memory"]
put arrayProductClockSpeed[Loop] into theVideoCardInfo[CardCount]["speed"]
put arrayProductCost[Loop] into theVideoCardInfo[CardCount]["cost"]
set the dgData of group "DataGrid 1" to theVideoCardInfo
end repeat
// display number of video cards found
put CardCount into Field "TotalCardsFound"
end mouseUp
-----------------------------------
However, I am after a command to clear the data grid once another button is selected. I've tried the put empty into data grid but that does not seem to work.
Cheers,
Steven
Working with data grids (clearing a datagrid)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 25
- Joined: Mon Oct 18, 2010 6:32 pm
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: Working with data grids (clearing a datagrid)
Hi Steven,
Did you tried?:
Best Regards,
Did you tried?:
Code: Select all
set the dgData of group "DataGrid 1" to empty
Best Regards,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
-
- Posts: 25
- Joined: Mon Oct 18, 2010 6:32 pm
Re: Working with data grids (clearing a datagrid)
Sorted, thanks!