开发者

how can I do quick searching in flex?

I used character based searching name in data grid by using http services . so i used text box and data grid , fcomptxt is text box id fComptxt.addEventListener(Event.CHANGE,applyFilter);

    public function applyFilter(e : Event):void {

      CompanyViewBean.companyViewBean = new CompanyViewBean();
          CompanyViewBean.companyViewBean.subAction
    = new XML("<actionContext><actionName>SearchCompany</actionName></actionContext>"); var nameSearch:String = fComptxt.text; CompanyViewBean.companyViewBean.companyName=<name>{nameSearch}</name>;    
xmlGeneration()

        }

In xmlgeneration function I sending request to sever using http services . But my clarification is

  1. if t开发者_运维百科hey typed fastly then get errors (http errors)
  2. Is it any possible do any other way implement quick searching
  3. i used keyboard down event and also keyboard up event then no use same problem occur.


If you can load up all the data at once, then you can use the sorting functionality of an ArrayCollection to filter data as the user types. It should be pretty quick.

But, if you want to ping the database after every keystroke, you're often going to have issues with lag time between server and client compared the speed of the user's typing.

I can see two options you might investigate:

  1. You could disable the text input after every keystroke until you get data back from the server.
  2. After each keystroke, You could cancel the "in process" remote request before starting the new one.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜