Xbrowse, tDolphin, Cell edition problem and solution

Xbrowse, tDolphin, Cell edition problem and solution

Postby Adolfo » Sun Feb 06, 2011 5:42 pm

Fivewinners...
Here there is a solution for a problem found qhen you try to edit a cell in xBrowse using tDolhpin queries

Change this in SetColFromMysql from class xBrowse

Code: Select all  Expand view
    If ::oMySql:IsKindOf( "TDOLPHINQRY" )
        oCol:bOnPostEdit      :=  { |o,x,n| If( n == VK_RETURN,( ::oMySql:FieldPut( nCol, x ), ::oMySql:Save() ),  NIL ) }
     Else
        oCol:bOnPostEdit      := { |o,x,n| If( n == VK_RETURN, ::onedit( o, x, n, cType, nCol ), NIL ) }
     Endif
 


Then you can edit the cell and save its value.
This was discovered by Daniel Garcia-Gil, after some minutes bothering him...

Greetings
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Xbrowse, tDolphin, Cell edition problem and solution

Postby nageswaragunupudi » Sun Feb 06, 2011 6:12 pm

Mr. Daniel

I am wondering where is this "onedit" method declared. I do not find it anywhere in the TXBrowse class.

To bring SetMySql ( for Dolphin ) method also inline with other Set... methods, I would suggest these modifications instead.

(for Dolphin)
oCol:bEditValue := { |x| If( x != nil, ::oMySql:FieldPut( nCol, x ),), ::oMysql:FieldGet( nCol ) }
oCol:cDataType := If( cType == nil, 'C', cType )
oCol:bOnPostEdit := { |o,x,n| If( n == VK_RETURN, o:Value := x, nil ) }
and in the SetMySql method:
::bOnRowLeave := { || ::oMySql:Save() }

Would u mind checking if this is working well? Does FieldPut() method in Dolphin take care of Readonly cursors?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse, tDolphin, Cell edition problem and solution

Postby Daniel Garcia-Gil » Sun Feb 06, 2011 7:19 pm

Mr. Rao

nageswaragunupudi wrote:I am wondering where is this "onedit" method declared. I do not find it anywhere in the TXBrowse class.

Really i didnt found "onedit" method... this code have so many time from was created "method SetColFromMySQL"... i tried use for Dolphin without take care (sorry)

nageswaragunupudi wrote:oCol:bEditValue := { |x| If( x != nil, ::oMySql:FieldPut( nCol, x ),), ::oMysql:FieldGet( nCol ) }
oCol:cDataType := If( cType == nil, 'C', cType )
oCol:bOnPostEdit := { |o,x,n| If( n == VK_RETURN, o:Value := x, nil ) }


no work, we need save after modify value

nageswaragunupudi wrote:Does FieldPut() method in Dolphin take care of Readonly cursors?

Dolphin check in save method, but the user can check by himself before FieldPut
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Xbrowse, tDolphin, Cell edition problem and solution

Postby goosfancito » Fri Apr 13, 2012 3:48 am

Adolfo, para que version de xbrowse es esto?

gracias.

Adolfo wrote:Fivewinners...
Here there is a solution for a problem found qhen you try to edit a cell in xBrowse using tDolhpin queries

Change this in SetColFromMysql from class xBrowse

Code: Select all  Expand view
    If ::oMySql:IsKindOf( "TDOLPHINQRY" )
        oCol:bOnPostEdit      :=  { |o,x,n| If( n == VK_RETURN,( ::oMySql:FieldPut( nCol, x ), ::oMySql:Save() ),  NIL ) }
     Else
        oCol:bOnPostEdit      := { |o,x,n| If( n == VK_RETURN, ::onedit( o, x, n, cType, nCol ), NIL ) }
     Endif
 


Then you can edit the cell and save its value.
This was discovered by Daniel Garcia-Gil, after some minutes bothering him...

Greetings
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests

cron