Another Data Grid problem

zryip theSlug zryip.theslug at gmail.com
Sun Nov 10 06:41:08 EST 2013


Hi Paul,

This is behaving like the template for your datagrid is missing.

For checking the existence of the datagrid template, you can execute this code:

put the dgProp["row template"] of grp "myDataGrid" into tTheTMPLGroup
answer there is a tTheTMPLGroup

where myDataGrid is the name of your datagrid group.

This test will probably return "false".

For linking the datagrid to a template, we have 2 possibilities:
- reusing an existing template located in the "data grid templates
xxx" substack in your project
- creating a new datagrid in the goal to force the creation of a new
template card in the "data grid templates xxx" substack. Once the
template created, we can delete the datagrid without confirming the
"delete record template" message

Then, once the datagrid template created or located, we can refresh
the template grp by using the following code:

set the dgProp["row template"] of grp "myDataGrid" to the long id of
grp "row template" of cd id xxx of stack "data grid templates xxx"


Alternate methods for adding a custom behavior:
1. A custom behavior may can be added by code. Because, each column is
represented as a grp in the datagrid template we can write:

put the dgProp["row template"] of grp "myDataGrid" into tTheTMPLGroup
set the behavior of grp "myColumnName" of tTheTMPLGroup to the long id
of btn "myBehavior"

Where the "myBehavior" button contains the script for the
"myColumnName" datagrid column.

2. As another alternative for adding a custom behavior, we have also
DGH, our commercial product. Here is an example for creating a
checkbox in a column:
http://lessons.runrev.com/s/lessons/m/4068/l/40587-how-do-i-create-a-checkbox-in-a-column

Images and numerous other things are supported by DGH the same way of
this example.



On Sun, Nov 10, 2013 at 8:44 AM, Paul Foraker <paul.foraker at gmail.com> wrote:
> I have a data grid with 11 columns. I want to display an image in each cell
> of column 1. I've go the key data in the cells. When I click the + button
> to add a custom behavior, nothing happens.
>
>
> Steps:
> Choose pointer tool.
> Click on data grid.
> In Property Inspector, select Columns.
> Click to select column 1 (already by default).
> Click the + button in the lower right of the Property Inspector window.
> Expected Result: the custom property editor window should open
> Actual Result: the + button highlights on the click, but does nothing
>
> Did I miss a step?
>
> Is there an alternate method of adding a custom behavior?
>
> LiveCode 6.1.2 | Build 2016
> Mac OS 10.7.5
> _______________________________________________
> 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



Best Regards,
-- 
Zryip TheSlug
http://www.aslugontheroad.com




More information about the use-livecode mailing list