Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    General question / best practice: When to use ListGrid.setAutoFetchData(true) ?

    Hi Isomorphic,

    I'm wondering why there is a mechanism like DataBoundComponent.setAutoFetchData(true).
    The docs say "Generally, turn off autoFetchData if you are going to manually call fetchData() at any time.", which is what I do.

    In which cases is it useful to have AutoFetchData? The two advantages I see are:
    • It saves a line of code
    • The framework **might** be able to recognize two simultaneously issued requests (from a draw() call to a Layout with many DataBound members?) and combine them in a Queue. I don't know if that's even done.

    Are there more advantages? When do you suggest to use autoFetchData?

    Thank you & Best regards,
    Blama

    #2
    autoFetchData is a minor convenience, useful partly because it can turn a programmatic call into a declarative setting in eg Component XML.

    Beyond that, there's not a best practice here aside what you've quoted from the docs: if you need to call fetchData() programmatically (there are dozens of reasons why you might need to), then don't use the autoFetchData setting.

    Comment


      #3
      Thanks for the fast answer. I'll do so.

      Best regards,
      Blama

      Comment

      Working...
      X