Page 1 of 1
Method ONEDIT does NOT exists for TXBRowse Column class
Posted:
Mon Oct 15, 2012 3:33 am
by shri_fwh
Hi ,
I defined XBROWSE for mySQL TDolphin Recordset and trying edit the data from the XBROWSE. When user edits any column value it gives an error like "Method does exists ONEDIT". Also I checked in the source code of XBrowse.prg I could not found the ::ONEDIT Method but, it is called in the code. If method is not exists then how code is compiled ? Please correct me if am wrong. So how can edit the values of mySQL TDolphin Recordset via XBROWSE ?
Thanks
Shridhar
Re: Method ONEDIT does NOT exists for TXBRowse Column class
Posted:
Mon Oct 15, 2012 12:48 pm
by Rick Lipkin
ShridharYou should be able to edit any cell with the FASTEDIT clause :
- Code: Select all Expand view
AUTOCOLS LINES CELL FASTEDIT
and in addition to FASTEDIT you can explicitly assign EDIT_GET to every column :
- Code: Select all Expand view
AEval( oLbxB:aCols, { |o| o:nEditType := EDIT_GET } )
Likewise you can assign EDIT_NONE to any specific column which over-rides any global EDIT_GET :
- Code: Select all Expand view
oLbxB:aCols[1]:nEditType := EDIT_NONE
There is a "pre" and a "post" edit code block you can utilize on a column as well :
- Code: Select all Expand view
oLbxB:aCols[3]:bOnPreEdit := { || If(oRsInvDetail:Fields("Inventory Id"):Value = " ", , __Keyboard( Chr( VK_HOME ))) }
oLbxB:aCols[3]:bOnPostEdit := {|o,v| _InvtLook( v, oRsInvDetail) }
Rick Lipkin
Re: Method ONEDIT does NOT exists for TXBRowse Column class
Posted:
Tue Oct 16, 2012 7:52 am
by shri_fwh
Hi Rick ,
Thanks a lot...! but I had done first two steps for edit, as I mentioned I got an error "ONEDIT method does not exists". However I will check as per your code and let you know. And may I know _InvtLook function does ?
Thanks
Shridhar
Re: Method ONEDIT does NOT exists for TXBRowse Column class
Posted:
Tue Oct 16, 2012 12:42 pm
by Rick Lipkin
Shridhar
You can create any user defined function to be called with the code block .. _InvtLook in this case was a inventory search routine for a stock number that was entered into the browse .. It demonstrates the versatility of the pre and post routine when you edit a cell.
Rick Lipkin
Re: Method ONEDIT does NOT exists for TXBRowse Column class
Posted:
Thu Oct 18, 2012 3:20 pm
by shri_fwh
Hi Rick ,
I have done the changes as you suggested, now its working
Thanks
Shridhar