On Monday 13 August 2007 07:06, johnf wrote:
> Hi,
>
> Is there a simple way of accessing the grid cursor to retrieve the changed
> data.
>
> Example: I populate a grid from a DataSource. The grid is Editable. I
> make changes to the data in grid - a boolean column. Is there a simple
> way to retrieve the all records where the boolean column is True?
>
> I thought I could use something like:
> Grid.DataSet.execute("Select * from dataset where lSelected = 1") but it
> appears to get the old data.
In the doc's for dGrid:
If DataSource is defined, DataSet is read-only and returns the dataSet
from the bizobj
This is why my SQL statement returns old values and not the grid values.
So again how do I read the current values of the frid data cursor??? Below I'm
using a for loop which just seems wrong.
I'm currently using:
moveds=self.distgridID.DataSet
moveqty=0
movedqty=0
baltomove=self.qtytomovepgf.BaseValue
for myitem in moveds:
oktouse=False
for key, value in myitem.items():
if key == 'nqty':
myqty = value
if key=='lselected' and value==1:
oktouse=True
if key=='clocation':
myloc=value
if oktouse:
nqty=myqty
moveqty=min(baltomove,nqty)
if moveqty>0:
o.new()
o.setFieldVal('clocation',myloc)
o.setFieldVal('nqty',-moveqty)
o.setFieldVal('ntransid',invtransno)
baltomove=max(baltomove-moveqty,0)
movedqty=movedqty+moveqty
if baltomove==0:
break
--
John Fabiani
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]