DataGrid AddData issue
zryip theSlug
zryip.theslug at gmail.com
Sat Mar 13 08:48:08 EST 2010
2010/3/13 Jeffrey Massung <massung at gmail.com>:
> So, I'm not quite sure the best way around this problem, hoping Trevor or someone here can help...
>
> It looks like AddData doesn't instantly add the data to a DG form (haven't tried a table). So, for example, if I were to do the following:
>
> ## inside the DG group control
>
> on doSomething
> -- .. construct some data ..
>
> addData tData
>
> get the dgNumberOfLines of me
> get the dgDataControlOfIndex[it] of me
>
> -- .. do something with the data control ..
>
>
> The problem here is that the data control I get back is not of the row I just added, but rather the row previous to it. This is really problematic as I'd like to call a handler on that control, but only when it's created. I also can't wait a little bit of time because several rows may be added in between.
>
> My best work-around thought for now is to have a flag in tData that is set to true so that FillInData can check it and call the appropriate handler and set it to false, but that's pretty hacky and I'd prefer being able to do it some other way.
Hello Jeffrey,
Have you tried to refresh the data with the "RefreshList" command
after the addData instruction?
Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
More information about the use-livecode
mailing list