Page 1 of 1

save changes made in Xbrowse

PostPosted: Wed Jun 14, 2017 10:34 pm
by Marc Venken
Hello,

I want to save changes made in xBrowse to a online file (MariaDB)

I"ve seen parts that uses
Code: Select all  Expand view

oBrw[1]:lColChangeNotify := .t.
oBrw[1]:bChange := { |oBrw, uOlddata| Changedata( oBrw, uOlddata ) }
or
oBrw[1]:bChange := { |obrw| OnColChange( oBrw ) }

function OnColChange( oBrw )

   // take action here
   ? oBrw:nColSel // --> new column number
   ? oBrw:SelectedCol() //--> new column object
   ? oBrw:SelectedCol():Value //--> value of the new column

   // using the above data you take your action

return nil
 


But maybe there is also a new method in Xbrowse that handle this better ?
If any change in a cell are done, then I want to save (Fieldname, oldvalue, newvalue)

So I also need the Older data of the cell, and the new data.

Any samples that uses this technique ?

Re: save changes made in Xbrowse

PostPosted: Thu Jun 15, 2017 2:48 am
by nageswaragunupudi
oCol:bOnChange := { |oCol, uOldVal| OnColChange( oCol, uOldVal ) }

function OnColChange( oCol, uOldVal )

// Save
// oCol:cExpr, oCol:Value, uOldVal

return nil