Datagrid Form

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Datagrid Form

Peter Haworth
Can't believe I haven't used a datagrid form before but trying one for the
first time this morning, following the instructions in the dg manual.

Set the dg type to "form"
Edited the row template to include a couple of fields and a check box
Added a button that sets up an array keyed by the field/checkbox names with
some data in each key and sets the dgData of the dg
Edited the FillInData of the row behavior get the data and put it into the
fields/set the hilite of the checkbox
Clicked the button to populate the dg

Nothing.

Set a breakpoint at the start of the FillInData handler and tried again.

At the start of the handler, my fields and checkbox show up in the datagrid
with no data in them.  As each line is executed to put the data into them,
nothing shows in the datagrid.  Each line looks something like:

put pDataArray["Company"] into field "Company" of me

pDataArray has the correct values in each key

Continued stepping through and next comes the LayoutControl handler. I
haven't changed that yet.  Step through each line, nothing changes in the
datagrid.  After stepping over the end LayoutControl, my fields/checkbox
all disappear and no more code is executed.

LC 6.6.5, OSX 10.10




Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Sri
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Sri
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
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Peter Haworth
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 <[hidden email]> 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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Mike Bonner
Silly question, but do you have the "cache controls" box checked in the
inspector for the datagrid?  If you uncheck it, and click the refresh
datagrid button, does the data show up?

If so, is there anywhere that you are manually telling the datagrid to
refresh in your code after the dg is populated?

Strangely, if Ihave "fixed control height" unchecked, and "cache controls"
checked, and refresh the datagrid, the datagrid will suddenly appear empty.
 checking fixed control height, or unchecking cache controls, will make it
show back up. (7.0.5)  But if I populate it using the button, it doesn't
seem to matter what is checked and what isn't, right up until a refresh is
done, hence the question about doing a refresh in your code somewhere.

On Fri, Jul 3, 2015 at 7:10 PM, Peter Haworth <[hidden email]> 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 <[hidden email]> 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
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Phil Davis-5
In reply to this post by Peter Haworth
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 <[hidden email]> 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
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Peter Haworth
In reply to this post by Mike Bonner
Cache controls is off and I'm not refreshing the datagrid anywhere in my
code.

On Fri, Jul 3, 2015 at 7:31 PM Mike Bonner <[hidden email]> wrote:

> Silly question, but do you have the "cache controls" box checked in the
> inspector for the datagrid?  If you uncheck it, and click the refresh
> datagrid button, does the data show up?
>
> If so, is there anywhere that you are manually telling the datagrid to
> refresh in your code after the dg is populated?
>
> Strangely, if Ihave "fixed control height" unchecked, and "cache controls"
> checked, and refresh the datagrid, the datagrid will suddenly appear empty.
>  checking fixed control height, or unchecking cache controls, will make it
> show back up. (7.0.5)  But if I populate it using the button, it doesn't
> seem to matter what is checked and what isn't, right up until a refresh is
> done, hence the question about doing a refresh in your code somewhere.
>
> On Fri, Jul 3, 2015 at 7:10 PM, Peter Haworth <[hidden email]> 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 <[hidden email]> 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
> > > [hidden email]
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Peter Haworth
In reply to this post by Phil Davis-5
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 <[hidden email]> 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 <[hidden email]> 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
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > 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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Vaughn Clement
In reply to this post by Peter Haworth
Hi Pete

Aren't you using datagrids in the SQLMagic interface? I have DataGrid
Helper and it greatly helped building DataGrids.

Thank you

Vaughn Clement

On Target Solutions LLC (Support)
On Target Solutions LLC Website: http://www.ontargetsolutions.biz
Email: [hidden email]
Skype: vaughn.clement

FaceTime: [hidden email]
Ph. 928-254-9062


On Fri, Jul 3, 2015 at 12:04 PM, Peter Haworth <[hidden email]> wrote:

> Can't believe I haven't used a datagrid form before but trying one for the
> first time this morning, following the instructions in the dg manual.
>
> Set the dg type to "form"
> Edited the row template to include a couple of fields and a check box
> Added a button that sets up an array keyed by the field/checkbox names with
> some data in each key and sets the dgData of the dg
> Edited the FillInData of the row behavior get the data and put it into the
> fields/set the hilite of the checkbox
> Clicked the button to populate the dg
>
> Nothing.
>
> Set a breakpoint at the start of the FillInData handler and tried again.
>
> At the start of the handler, my fields and checkbox show up in the datagrid
> with no data in them.  As each line is executed to put the data into them,
> nothing shows in the datagrid.  Each line looks something like:
>
> put pDataArray["Company"] into field "Company" of me
>
> pDataArray has the correct values in each key
>
> Continued stepping through and next comes the LayoutControl handler. I
> haven't changed that yet.  Step through each line, nothing changes in the
> datagrid.  After stepping over the end LayoutControl, my fields/checkbox
> all disappear and no more code is executed.
>
> LC 6.6.5, OSX 10.10
>
>
>
>
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form

Peter Haworth
Yes, but only tables so far.  Looking into adding support for forms.

On Sat, Jul 4, 2015 at 11:08 AM Vaughn Clement <[hidden email]> wrote:

> Hi Pete
>
> Aren't you using datagrids in the SQLMagic interface? I have DataGrid
> Helper and it greatly helped building DataGrids.
>
> Thank you
>
> Vaughn Clement
>
> On Target Solutions LLC (Support)
> On Target Solutions LLC Website: http://www.ontargetsolutions.biz
> Email: [hidden email]
> Skype: vaughn.clement
>
> FaceTime: [hidden email]
> Ph. 928-254-9062
>
>
> On Fri, Jul 3, 2015 at 12:04 PM, Peter Haworth <[hidden email]> wrote:
>
> > Can't believe I haven't used a datagrid form before but trying one for
> the
> > first time this morning, following the instructions in the dg manual.
> >
> > Set the dg type to "form"
> > Edited the row template to include a couple of fields and a check box
> > Added a button that sets up an array keyed by the field/checkbox names
> with
> > some data in each key and sets the dgData of the dg
> > Edited the FillInData of the row behavior get the data and put it into
> the
> > fields/set the hilite of the checkbox
> > Clicked the button to populate the dg
> >
> > Nothing.
> >
> > Set a breakpoint at the start of the FillInData handler and tried again.
> >
> > At the start of the handler, my fields and checkbox show up in the
> datagrid
> > with no data in them.  As each line is executed to put the data into
> them,
> > nothing shows in the datagrid.  Each line looks something like:
> >
> > put pDataArray["Company"] into field "Company" of me
> >
> > pDataArray has the correct values in each key
> >
> > Continued stepping through and next comes the LayoutControl handler. I
> > haven't changed that yet.  Step through each line, nothing changes in the
> > datagrid.  After stepping over the end LayoutControl, my fields/checkbox
> > all disappear and no more code is executed.
> >
> > LC 6.6.5, OSX 10.10
> >
> >
> >
> >
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> > Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> > SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid Form [Solved]

Peter Haworth
In reply to this post by Peter Haworth
OK, mystery solved.  I had to set the "empty row height" property of the
datagrid (in the Inspector) to the height of the row template.  As soon as
I did that, all works fine.

I'm not sure why I needed to do that.  The Datagrid manual includes this in
its description of the dgProps["row height"]:

  "If this property is not set for a form whose 'fixed control height' is
true then the record template group height is used."
 Anyway, I'm happy now.

Pete

On Sat, Jul 4, 2015 at 9:26 AM Peter Haworth <[hidden email]> wrote:

> Cache controls is off and I'm not refreshing the datagrid anywhere in my
> code.
>
>
> On Fri, Jul 3, 2015 at 7:31 PM Mike Bonner <[hidden email]> wrote:
>
>> Silly question, but do you have the "cache controls" box checked in the
>> inspector for the datagrid?  If you uncheck it, and click the refresh
>> datagrid button, does the data show up?
>>
>> If so, is there anywhere that you are manually telling the datagrid to
>> refresh in your code after the dg is populated?
>>
>> Strangely, if Ihave "fixed control height" unchecked, and "cache controls"
>> checked, and refresh the datagrid, the datagrid will suddenly appear
>> empty.
>>  checking fixed control height, or unchecking cache controls, will make it
>> show back up. (7.0.5)  But if I populate it using the button, it doesn't
>> seem to matter what is checked and what isn't, right up until a refresh is
>> done, hence the question about doing a refresh in your code somewhere.
>>
>> On Fri, Jul 3, 2015 at 7:10 PM, Peter Haworth <[hidden email]> 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 <[hidden email]> 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
>> > > [hidden email]
>> > > Please visit this url to subscribe, unsubscribe and manage your
>> > > subscription preferences:
>> > > http://lists.runrev.com/mailman/listinfo/use-livecode
>> > >
>> > _______________________________________________
>> > use-livecode mailing list
>> > [hidden email]
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode