Dynamically Set the height of DataGrid

Bob Sneidar bobsneidar at iotecdigital.com
Mon Dec 10 16:57:48 EST 2018


The trouble with modigying the datagrid behavior itself is that you have to do that everytime you install a new version! It used to be you could copy the code in the script of the behavior button, paste it into a new button in your app then set the dg behavior to the new button ID, but that does not work anymore, on account of the way they are using script only stacks now. 

I have inserted a custom behavior before the default behavior, but I have to make a couple mods in the script only behaviors to get them to work. This was discussed a while back, and someone figured out a way to get nested behaviors to work. I think they said that the hotfix will be bundled into 9.1, so then I won't have to customize the behaviors after that. 

There is no "best practice" when it comes to these things. At best they are hacks, but the benifit outweighs the hazards, so we go for it. 

As far as your dg not refreshing, if you already set the dgNumberOfRecords/lines, then the auto refresh of the datagrid will be turned off, and it won't refresh on it's own. (Someone may correct me on this). 

RefreshIndex

    RefreshIndex pIndexes
    Redraws row associated with pIndexes using latest data. Use this command in conjunction with SetDataOfIndex. pIndexes can be a comma delimited list of indexes.

RefreshLine

    RefreshLine pLines
    Redraws row using latest data. Use this command in conjunction with SetDataOfLine. pLines can be a comma delimited list of lines.

Bob S

> On Dec 10, 2018, at 09:59 , Sannyasin Brahmanathaswami via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 1) question a hierarchy? The command that we want to use to customize (dgprops gives everything!). are they better "externalized" the Datagrid before showing it...OR in better to encapsulate in the behavior script  of the DG itself. Say, in the "LayoutControl" handler.
> 
> Of course you are going to say. "Depends on your context, if you want new one to have the same customization... better make it external."   
> 
> But then those of you have done this a while have a preferred "best" practice.. What is it?
> 
> 2) Now, if I could just do a proper "Refresh" 
> ...nothing I will do in the current RowTemplate affects the datagrid...."argh". which take all it color from Item Inspector of the datagrid as a whole... it as if the "mask" that the rowtemplate is not being rendering. Just the "elements" but not the colors and size
> 
> Brahmanathaswami





More information about the Use-livecode mailing list