View Full Version : Form loading question

21 Jul 2009, 10:31 AM
Which is best? form.load() or loading all data into a store and pulling the data from that store?

I have about 3-5 forms on 1 page and with the current implementation I am calling form.load() on all the forms, each having their own ajax call to load data. Is there really any advantage to migrating to a 1 ajax call, load information into a store and then having all the forms feed from that 1 store? There are also a couple comboboxes per form so there just seems like a lot of communications between the app and server, does it really matter?

This app is only intended for small use, 1-5 people. Thanks for the advice/opinions.

22 Jul 2009, 2:34 AM
No need for a store if you're just loading data. form.load will invoke an XHR to the server. The problem with going w/ the store approach is that you're loading similar or like-records. Why not just use Ext.Ajax.request to get the data, then use Ext.encode on the response.resultText and then use setValues on each of the form with the appropriate data?

22 Jul 2009, 9:33 AM
Ya, the more I worked with the store approach, the more I realized it was a pain in the butt. Sounded great in theory, however it was becoming increasingly difficult to work with.

With that said, I went back to the form.load() method and everything is working great now. :) Just had to solve a couple custom combobox timing/loading issues but I think I got it working now, thanks for the response!