DataGrid AddData issue

Jeffrey Massung massung at gmail.com
Fri Mar 12 23:21:00 EST 2010


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.

Any other ideas appreciated.

Jeff M.


More information about the use-livecode mailing list