def OnModifyItem(self,event): data=[] try: #print "self.culselrow is", self.cuselrow for col in range(len(self.py_colables)): tempdata=list(self.py_colables[col]) tempdata.append(self.m_gridctrl.GetCellValue(self.cuselrow,col) ) data.append(tempdata) except: wx.MessageBox("db error") return newdialog = productMandialog(self, u"修改产品",data, cntx=self.cntx, ptype=self.pTypeData, flag='modify') newdialog.Centre(wx.BOTH) newdialog.ShowModal() if newdialog._successOut == True: self._UpdateGridData(newdialog) self.m_gridctrl.ForceRefresh() else: return
def OnGridSelDbClicked(self,event): data=[] try: row = event.GetRow() for col in range(len(self.py_colables)): tempdata=list(self.py_colables[col]) tempdata.append(self.m_gridctrl.GetCellValue(row,col) ) data.append(tempdata) except: wx.MessageBox("db error") newdialog = productMandialog(self,u"查看产品",data, cntx=self.cntx, ptype=self.pTypeData) newdialog.Centre(wx.BOTH) newdialog.ShowModal()
def OnNewItem(self,event) : data=[] for col in range(len(self.py_colables)): tempdata=list(self.py_colables[col]) tempdata.append('') data.append(tempdata) #print "data is",data #currenttable = self.m_gridctrl.GetTable() #currenttable.InsertRows(self.cuselrow, newdata) newdialog = productMandialog(self,u"新建产品",data, cntx=self.cntx, ptype=self.pTypeData, flag='new') newdialog.Centre(wx.BOTH) newdialog.ShowModal() if newdialog._successOut == True: currenttable = self.m_gridctrl.GetTable() currenttable.InsertRows(self.cuselrow) self._UpdateGridData(newdialog) self.m_gridctrl.ForceRefresh()