On Sat, Sep 11, 2010 at 8:08 PM, Stanislav Colotinschi <
[email protected]> wrote:
> I have one more question. Let's suppose I pressed the Search button
> once, the data was filtered and redisplayed for me. At this moment,
> let's introduce some details: there are some textboxes, which I am
> getting expressions from. So, I have:
> def onHit(self, evt):
> grd = self.Form.cltable
> usrVal = self.Form.usernameEdit.Value
> biz = self.Form.getBizobj(grd.DataSource)
> if usrVal:
> biz.filter("username",usrVal,"contains")
> biz.filter("state",True,"eq")
> grd.update()
>
> And, I want to change the username in the textbox, press again Search
> and obtain another result, that is, data. But I have just an empty grid.
> I suppose that the dataset should be reinitialized(?) somehow. But how
> can I do it?
>
biz.removeFilters() <<--- add this line to get back your original data
biz.filter("username", usrVal, "contains")
See also the "DataSets" section of the PyCon 2010 Tutorial:
https://docs.google.com/View?id=dg79jzmg_85f737ww6x#DataSets_774685699492693_48992
-- Mark
> --
> Respect,
> Stanislav Colotinschi.
>
> _______________________________________________
> 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/[email protected]
>
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
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/[email protected]