(DataGrid) is there a message when the user has edited a cell ?

Andre.Bisseret Andre.Bisseret at inria.fr
Fri Jul 9 11:20:41 EDT 2010


Le 9 juil. 10 à 16:12, zryip theSlug a écrit :
> but instead to have a Sum button outside the Data Grid, you try to  
> refresh
> the Sum with the closeFieldEditor, right?

Yes, up to now I have a button outside the data grid but I would have  
like to re calculate the sums automatically as soon as the user had  
changed the value of any cell.

Le 9 juil. 10 à 16:25, zryip theSlug a écrit :

> The correct usage of the closeFieldEditor is to use it in the  
> default column
> behavior or the column behavior of thecolumns to sum (Débit and  
> Crédit)
>
> Add a column behavior to the first column (Débit), and edit the  
> behavior.

Ah! OK! more complex than I was hoping ;-))

In fact currently, in this app. I did not need any template stack so I  
am just using
  "copy group "DataGrid" of group "Templates" of stack  
"revDataGridLibrary" to this card" to get the first one and then I  
copy it when necessary ;-)

Then I can't add a column behavior.

I have still to learn much more about managing the behaviors of the  
data grids ;-))

I am going tol try your solution with a datagrid drawn from the  
palette tool in order to get a template stack.

Thanks a lot for your attention and help

Best regards

André


>
> In the script, change the closeFieldEditor like this:
>
> on closeFieldEditor pFieldEditor
>  set the text of fld "fldTotDébit" to the uSumOfColumn["Débit"] of the
> dgControl of me
>  set the text of fld "fldTotCrédit" to the uSumOfColumn["Crédit"] of  
> the
> dgControl of me
> end closeFieldEditor
>
> Untested but should work.
>
> If all is ok, update the column behavior of the "crédit" column with  
> the
> same script


>
> 2010/7/9 Andre.Bisseret <Andre.Bisseret at inria.fr>
>
>> Bonjour TheSlug,
>>
>> Thank you for your reply.
>>
>> Seems I am missing something
>>
>> I have 2 fields under the datagrid where I want to put the total of 2
>> columns of the datagrid  (fldTotDébit and fldTotCrédit)
>>
>> In the script of the datagrid, I put:
>>
>> on closeFieldEditor pFieldEditor
>>  set the text of fld "fldTotDébit" to the uSumOfColumn["Débit"] of me
>>  set the text of fld "fldTotCrédit" to the uSumOfColumn["Crédit"]  
>> of me
>> end closeFieldEditor
>>
>> but when I edit a cell of the datagrid nothing happens
>> Could be because I don"t know what should be the parameter  
>> pFieldEditor?
>>
>> André
>>
>>
>> Le 9 juil. 10 à 14:37, zryip theSlug a écrit :
>>
>> Bonjour André,
>>>
>>> You have to use the CloseFieldEditor event.
>>>
>>> Have a look to this lesson:
>>> http://lessons.runrev.com/manuals/datagrid/lessons/7335
>>>
>>> Regards,
>>>
>>> 2010/7/9 Andre.Bisseret <Andre.Bisseret at inria.fr>
>>>
>>> Bonjour,
>>>>
>>>> I have quite small editable data grids.
>>>>
>>>> I would like to re-calculate the totals of the columns after the  
>>>> user has
>>>> changed the value of any cell.
>>>>
>>>> I don't need to know what cell was edited.
>>>>
>>>> What message should I use ?
>>>>
>>>> Thanks in advance for any advice
>>>>
>>>> Best regards from Grenoble (very hot here!)
>>>>
>>>>
>>>
>>>
>>> --
>>> -Zryip TheSlug- wish you the best! 8)
>>> http://www.aslugontheroad.co.cc
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
>
>
> -- 
> -Zryip TheSlug- wish you the best! 8)
> http://www.aslugontheroad.co.cc
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution






More information about the use-livecode mailing list