#1176: dropdownlist with key in grid
-------------------------------------+--------------------------------------
Reporter: aecker | Owner: somebody
Type: discussion | Status: new
Priority: minor | Milestone: 0.8.3
Component: ui | Version: 0.8.4
Keywords: keyed dropdownlist grid |
-------------------------------------+--------------------------------------
I don't could find out how to add key values to a dropdownlist (column
object) within a grid column. I can use wxGridChoiceEditor to get a
dropdownlist like in the following example:
{{{
self.addColumn(
dabo.ui.dColumn(self, DataField="C_DESC",
Caption="Company",
Sortable=True, Searchable=True, Editable=True, DataType="list",
ListEditorChoices =
self.getChoices(self.Application.biz.Companies) ))
def getChoices(self, bizClass):
app = self.Application
bizObj = bizClass(app.dbConnection)
bizObj.requery()
pref = bizObj.KeyField[:1]
choices = ["(select)"]
#keys = {"" : 0}
for co in bizObj.bizIterator():
choices.append("%s" % bizObj.getFieldVal(pref +
"_DESC"))
#keys[bizObj.getFieldVal(pref + "_ID")] =
len(choices) - 1
return choices
}}}
But the 'value' of this column is always the diplayed text/caption of the
list items. I would need a key value instead like the in the dabo
dDropdownList. Any ideas/hints?
--
Ticket URL: <http://trac.dabodev.com/ticket/1176>
Dabo Trac <http://trac.dabodev.com>
Trac Page for Dabo
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]