Cloning data grids... text properties problematic [SOLVED]

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Cloning data grids... text properties problematic [SOLVED]

Post by stam » Mon Mar 14, 2022 4:25 am

*snip*
All works as expected except i cannot edit the row template of the copied/cloned data grid when doing this to another stack..
*snip*
-----------------------------------
EDIT: i solved the issue by not cloning new data grid template stack to the destination topstack, but instead copying the card corresponding to the source data grid to the destination data grid's template substack (creating a new substack from scratch if needed first).

The end result is that this can now
- copy an existing substack to a new stack and i will work as expected
- 'clone' a stack so that the destination stack is identical to the source stack even if on another stack

On my testing both methods should produce a faithful replica of the source datagrid and now the row template can be edited normally.

Would be really grateful if others could test -- make sure you're not using this on critical work when testing though (i take no responsibility ;) )

Many thanks
Stam

--- EDIT ---
Attachment removed as several bugs were found. New post for fixed version below.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Cloning data grids... text properties problematic [SOLVED]

Post by stam » Wed Mar 16, 2022 3:16 pm

Nearly there now i think.

- Fixed 2 problems with destination template stack not being referenced in the destination data grid's dgProps
- Fixed setting of destination template's card in the destination substack pointing to the source card's behaviour
- Fixed problem with the data grid's scrollbar properties which are now copied separately, as they aren't included in the group properties.

As far as i can see (for my own uses at least) this is now fixed. If any further issues crop up will post an update in case someone else needs this...
Attachments
skDataGridCloner.livecode.zip
(6.49 KiB) Downloaded 60 times

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”