On 03/28/2013 05:12 PM, Aleq wrote:
May be I need to explain what I'm trying to do. Basicaly I have a database
of people with their birth dates. I want to make a form to search for
specific date or month (this month, previous month, next month) and display
result in a grid. When data is displayed and on the next search data in
grid is doubled, the third time is trippled etc. All my codeis in dTextBox
object onHit method. What am I doing wrong?
I see you, have a dynamic lookup and need the populate the grid with the
correct information based on the lookup.
I would use a dynamic SQL to populate the grid. Something like the
following:
class dataGrid(dabo.ui.dGrid):
def afterInit(self):
self.super()
self.DataSet = self.Form.someMethod()
col1 = dabo.ui.dColumn(self, Order=20, DataField="field_name",
DataType="string", Caption="Date",
Sortable=True, Searchable=False,
Editable=False, HorizontalAlignment = 'Center')
self.addColumn(col1)
...
You can also use 'DynamicDataSet' property.
In the form
def someMethod(self):
searchStr = self.RegID.Value #you need to set the RegID for the
grid when you create it.
csql = """Select some_fields from table where field_name = %s
"""(searchStr)
self.temp_cursor.execute(csql)
Dset = self.temp_cursor.getDataSet()
return Dset
The you need to update or refresh (not sure about refresh) the grid as
some action to an event (like a button).
Hope this helps.
Johnf
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]