How to import a stack with dataGrid into another mainStack?

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: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

How to import a stack with dataGrid into another mainStack?

Post by giovannic » Tue Jul 14, 2009 3:00 pm

Hi all!
I've a little question for u hoping u can help me.
I'm working on a stack using a simple dataGrid with a modified script and row template.
In future I've to use this stack as substack of another stack in which there are other configured and fully functional dataGrids.
Now my question is: how can I import the stack with dataGrid in other substacks? What have I to do to have my dataGrid functional when the template is in a stack "datagrid template XXXX" and I've to import it in another mainstack?

I hope u can answer this simple question. The risk for me is that I do a lot of work to personalize my dg template and script and, when I'll import my stack as substack, I've to begin this personalization from scratch! Brrrr!!! Bye-

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Tue Jul 14, 2009 3:12 pm

Hi giovanni,

try this:
1. Make a copy of your stack with the datagrid! :-)
2. Open your stack with the datagrid
3. Open its substack "Datagrid template..."
4. Open your mainstack "XXX"
5. In the stack "Inspector" of stack "Datagrid template..." select "XXX" as the new mainstack
6. Do the same for your stack with the datagrid
7. Save your mainstack "XXX"

That was it :)

You have to do it this way, since you cannot make a stack with substack(s) a substack of another (main-)stack.

Best

Klaus

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

Post by giovannic » Tue Jul 14, 2009 3:51 pm

Hi Klaus. First of all TY for your reply.
It's really clear but my problem it's another.
I'm unable to do what u say because my future mainstack (that u call "XXX") contains by itself a dataGrid template used in other datagrid it use, so I can't import another "data grid template..." as substack as it have already one...

I hope to be clear explaining my problems.
Sorry, but my english is really bad.

Bye-

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Tue Jul 14, 2009 5:33 pm

Buonasera Giovanni,

are you sure that the stack names are really identical?
Please doublecheck! :-)

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

Hi!

Post by giovannic » Tue Jul 14, 2009 6:21 pm

Hi Klaus!
Yes, I'm sure!!!
We are developing different parts of the same application, starting from a common base stack...
Can I force my dg to use another "datagrid template" stack so I can import the new one in the main app stack?

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Tue Jul 14, 2009 6:39 pm

Ciao Givanni,

OK, just wnated to be sure :-)

Her is what you could try:
1. open the stack with the datagrid that you wnat to make a substack of.
2. open the substack "Datagrid template XXX"
3. Rename that stack, maybe just change the last number
4. open the "Inspector" for you datagrid
5. choose "Custom Properties" in the popup
6. Select "dgProps" in the popup "Set" (middle of Inspector
7. find the cp "row template"
8. change its content according to 3.

Now you can use the technique describe in my earlier post to make these two substacks of your mainstack.

I personally keep the "template" stacks as external mainstacks in my projects using the technique described above.
Took a while until I discovered how this works, Datagrids are a quite complex beast :)


Best

Klaus

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

Perfect!

Post by giovannic » Wed Jul 15, 2009 6:57 am

Hi Klaus.
As I read it in DG documentation I've never tried to rename the stack "datagrid template xxx", so I've never tried to do this!
Then I'll try the following:
1) extract the dg template, reimporting it as as new substack with a new name;
2) change the dg template custom property of all my new datagrid to have them use the new template
3) in the future export my new stack and my template.

Thank u for all ur support and time!

Bye

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

It's OK!

Post by giovannic » Wed Jul 15, 2009 7:27 am

Hey! I've tried the procedure descripted above and it runs perfectly!
Now my new stacks are indipendent from the original datagrid template and I simply can export all of them importing in the other mainstack.

TY for all and bye-

POSTEDIT:
It's ok for row template but "Row Behavior" refeer always to the old stack template... I've searched through the custom properties but there's nothing about this... or I'm unable to find it!!!
Thank u- Bye

POSTEDIT 2: Nevermind! I've found it! It's in the behavior of group of template!!! Now it's really all OK!!!

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Wed Jul 15, 2009 8:38 am

Gratulatione :)

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

Post by giovannic » Wed Jul 15, 2009 10:42 am

Klaus wrote:Gratulatione :)
Eh eh! I think u would say "Congratulazioni"!
Tnx

But I went over this!!!
To have full portability of my stacks now I incorporate the dg template in a card of the stack in which i'm working on, resetting the right parameters (id of template and id ot the behavior button) every time I use the stack (only 2 instructions)!
It runs perfectly and allow me to port my stack everywhere I want!
Hope this can be useful for other ppl in situations like mine!

Bye-

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Wed Jul 15, 2009 10:50 am

Si, Congratulazioni, certo!

My italian is really lousy, but my latin is better ;)

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

LOL

Post by giovannic » Wed Jul 15, 2009 12:31 pm

:D don't worry about ur italian!
Probably it's better than my english!!! LOL

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Wed Jul 15, 2009 12:38 pm

E possibile, ma improbabile!

But my favourite italian phrase is definitively:
Questi cazzi di piccione! :D

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

:D

Post by giovannic » Wed Jul 15, 2009 2:11 pm

LOOOOOOL!!!!

With ur favorite phrase u could live in
many of the biggest italian cities!!!

LOOOOOOL!!!!

Klaus
Posts: 11260
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Wed Jul 15, 2009 2:13 pm

8)
:D

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”