Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Best practice needed: ListGrid with setViewState(...)

$
0
0
Hi Isomorphic,

I have the following simple usecase:
A ListGrid with persisted ViewState information (Fieldstate, Sortstate, Groupstate separately set from DB, Hilites static, no SelectState).

Right now my flow is:
  1. setHilites(default hilites)
  2. setFields(...)
  3. ViewStateDS.fetch(myUser, listGridName), in CallBack
    • if ViewState found
      1. setFieldState(fieldState)
      2. setSortState(sortState)
      3. setGroupState(groupState)
    • if ViewState not found
      1. setSort(default SortSpecifiers)
      2. setGroup(default groupBy-fieldname)
    • fetchData()

This way I see a change in the ListGrid structure after the ViewStates is applied or the Default sorts/grouping are set.

Is there a better way to "design" the ListGrid before showing it? Also, I'm delaying my fetch(...) for the ListGrid-Data until the fetch for ViewState returned, which I don't like.

What is the proposed way of showing a ListGrid with ViewState?
One thing I could think of is to pre-fetch all my ViewStates at application start, but I don't know if this helps (and is necessary), as I could imagine that the ResultSet-layer purges these quite big results pretty fast.

Could you please suggest, Isomorphic?

Thank you & Best regards,
Blama

Viewing all articles
Browse latest Browse all 4756

Trending Articles