Datagrid Form

Peter Haworth pete at lcsql.com
Sat Jul 4 18:37:35 CEST 2015


Hi Phil,
I commented out the LayoutControl code but still no joy.  Wonder why it
works for you.  Would you mind sending me your version of the stack
offline?

I think the problems start before LayoutControl since even when I step thru
the code with debugger, none of the data values turn up in the dg fields.

The only thing left is perhaps an issue with how I set up the row
template.  Its structure looks like this:

group "Row Template"
   graphic "Background"
   field "Company Name"
   field "Address"
   button "Customer"


Looks different than the template for a dg table but I think that's
expected.  I also checked it against the row template for the Datagrid
Sampler stack that's in one of the online lessons for datagrids and it
looks exactly the same except for the fact the the group is named "Record
Template" not "Row Template" but I doubt that makes any difference.

One thing I did notice is that the default template had a field named
"Label" which was referenced in a couple of places in the behavior script.
I removed it and commented out all references to it in the script since it
didn't seem to serve any purpose.  In fact, I'm not sure why a template
behavior script would include a reference to any field, especially by name.

On Fri, Jul 3, 2015 at 7:49 PM Phil Davis <revdev at pdslabs.net> wrote:

> Hi Pete,
>
> Try commenting out all the code inside your 'LayoutControl' handler and
> see if that changes your outcomes. Using the code you posted here, I was
> able to build a DG and populate two rows, but I commented out the
> layoutControl code for the test.
>
> Best -
> Phil Davis
>
>
> On 7/3/15 6:10 PM, Peter Haworth wrote:
> > Hi Sri,
> > Yes  I tried a refresh (from the Inspector palette for the datagrid),
> > didn't make any difference.
> >
> > Here's my FillIInData code.
> >
> > on FillInData pDataArray
> >
> >     put pDataArray["Company Name"] into field "Company Name" of me
> >     put pDataArray["Address"] into field "Address" of me
> >     set the hilite of button "Customer" of me to pDataArray["Customer"]
> >
> > end FillInData
> >
> > As mentioned, pDataArray has the expected values in it's keys.
> >
> > Here's my LayoutControl code.  I didn't reposition any of the controls
> but
> > left that one line in there since I wasn't sure if it was needed or not.
> >
> > on LayoutControl pControlRect
> >
> >     set the rect of graphic "Background" of me to pControlRect
> > end LayoutControl
> >
> > Here's the code in my button to populate the datagrid.
> >
> > on mouseUp
> >
> >     local tData
> >
> >     put "lcSQL Software" into tData[1]["Company Name"]
> >     put "PO Box 123" & return & "Soquel" & return & "CA 95073" & return &
> > "USA" into tData[1]["Address"]
> >     put true into tData[1]["Customer"]
> >
> >     put "Mollys Revenge" into tData[2]["Company Name"]
> >     put "123 Some Street" & return & "Somewehere" & return & "OH 12345" &
> > return & "USA" into tData[2]["Address"]
> >     put false into tData[2]["Customer"]
> >
> >     set the dgData of group "dgForm" to tData
> >
> > end mouseUp
> >
> >
> > I can't attach screen shots (?) but as mentioned before, at the start of
> > the FIllInData handler, I see all the controls turn up in the datagrid so
> > I'm taking that to mean my customization of the row template is correct.
> > But I never see the data turn up as I step though each line in FillInData
> > and the controls all disappear when the "end LayoutControl" command is
> > executed.
> >
> > I should also say that even the dgData I send to the datagrid has two
> sets
> > of data in it and I see FillInData called for both sets, I only ever see
> > one set of controls before the datagrid is celared.
> >
> >
> > On Fri, Jul 3, 2015 at 5:32 PM Sri <sritcp at gmail.com> wrote:
> >
> >> Hi Pete:
> >>
> >> I'd like to see the code (stripped down version).
> >>
> >> Also, did you try to manually refresh the datagrid and see (after
> stepping
> >> over some code)?
> >>
> >> Regards,
> >> Sri
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://runtime-revolution.278305.n4.nabble.com/Datagrid-Form-tp4693596p4693598.html
> >> Sent from the Revolution - User mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-livecode at lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
> --
> Phil Davis
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list