Re: editing data grid column via scrip

2019-02-06 Thread Hershel F via use-livecode
Thanks, i did something very similar.work fine a bit funky but it does the job 
for now.


Thank you.

HerhelF


> On Feb 6, 2019, at 12:11 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> Not sure what you mean here. In the data grid tab of the properties window 
> there is an option to Allow Editing. Double clicking the cell with this 
> option set will allow you to edit the value. 
> 
> This seems klunky to me. What I do is I create a field for each editable 
> value in the datagrid, then have a closeField handler in the field do the 
> updating of the datagrid record. 
> 
> on closeField
>   put the dgHilitedIndex of group "myDataGrid" into tHilitedIndex
>   put the dgDataOfIndex [tHilitedIndex] of group "myDataGrid" into aGridRecord
>   put the text of me into aGridRecord [myColumn]
>   set the dgDataOfIndex [tHilitedIndex] of group "myDataGrid" to aGridRecord
> end closeField
> 
> This then allows you to do some error checking and validation in the 
> closeField handler. Use exitField instead to process your data each time the 
> field loses focus. 
> 
> Bob S
> 
>> On Feb 5, 2019, at 14:31 , Hershel F via use-livecode 
>>  wrote:
>> 
>> Hi everyone, i searched high and low for this without success.
>> Question, i have a data grid (trying to to set up an invoice form),
>> columns, costumer_id, product_id, company_name, product_name, price. etc.
>> option menus in product name and company name, 
>> Now when i use the options to select a product name, (product_name col.) i 
>> want to put the product id  into the product_id column by selecting the 
>> option menu btn, i tried many ways even when it went in it didn’t show up in 
>> the send "printkeys" to group  “data_grid_0” . all help would appreciate it.
>> 
>> Thanks in advanced. Hershel F
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: editing data grid column via scrip

2019-02-06 Thread Hershel F via use-livecode
Hi and thanks, 
i’ll try to be a clearer.
all editing is done only via option menu scripts.

as mentioned earlier, an option menu in the company column and product column. 
now a mouseDown in the OM collects all company names then on menuPick the 
selected company is chosen at the same time the company id is fetched from a 
database and that id must go into the id field (column) so in other words…

|  company_id | company_name  | product_id | product_name | price |extended 
price |
——— 

  total price 

 (all id col are hidden.)

as said above, company name is entered via menuPick, company_id should be 
entered via script in menuPick into company_id fld. which is done.(put  “abc”  
into fld “company_id” & “0001” ) the problem is that the text shows in the 
fld but does not show in the printKeys. now i tried to send a closeField to the 
fld which it did trigger but didn’t change anything .




Thanks in advanced. HershelF

> 
> Not sure what you mean here. In the data grid tab of the properties window 
> there is an option to Allow Editing. Double clicking the cell with this 
> option set will allow you to edit the value. 

No clicking possible. 
> 
> This seems klunky to me. What I do is I create a field for each editable 
> value in the datagrid, then have a closeField handler in the field do the 
> updating of the datagrid record. 

also i’m not sure i understood what you said.

> 
>> 
>> Thanks in advanced. Hershel F
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: editing data grid column via scrip

2019-02-06 Thread Bob Sneidar via use-livecode
Not sure what you mean here. In the data grid tab of the properties window 
there is an option to Allow Editing. Double clicking the cell with this option 
set will allow you to edit the value. 

This seems klunky to me. What I do is I create a field for each editable value 
in the datagrid, then have a closeField handler in the field do the updating of 
the datagrid record. 

on closeField
   put the dgHilitedIndex of group "myDataGrid" into tHilitedIndex
   put the dgDataOfIndex [tHilitedIndex] of group "myDataGrid" into aGridRecord
   put the text of me into aGridRecord [myColumn]
   set the dgDataOfIndex [tHilitedIndex] of group "myDataGrid" to aGridRecord
end closeField

This then allows you to do some error checking and validation in the closeField 
handler. Use exitField instead to process your data each time the field loses 
focus. 

Bob S
 
> On Feb 5, 2019, at 14:31 , Hershel F via use-livecode 
>  wrote:
> 
> Hi everyone, i searched high and low for this without success.
> Question, i have a data grid (trying to to set up an invoice form),
> columns, costumer_id, product_id, company_name, product_name, price. etc.
> option menus in product name and company name, 
> Now when i use the options to select a product name, (product_name col.) i 
> want to put the product id  into the product_id column by selecting the 
> option menu btn, i tried many ways even when it went in it didn’t show up in 
> the send "printkeys" to group  “data_grid_0” . all help would appreciate it.
> 
> Thanks in advanced. Hershel F

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

editing data grid column via scrip

2019-02-05 Thread Hershel F via use-livecode
Hi everyone, i searched high and low for this without success.
Question, i have a data grid (trying to to set up an invoice form),
columns, costumer_id, product_id, company_name, product_name, price. etc.
option menus in product name and company name, 
Now when i use the options to select a product name, (product_name col.) i want 
to put the product id  into the product_id column by selecting the option menu 
btn, i tried many ways even when it went in it didn’t show up in the send 
"printkeys" to group  “data_grid_0” . all help would appreciate it.

Thanks in advanced. Hershel F
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode