0

I'm trying to make an email form with extjs 4 that sends an email to 12000 company members at a time.

The server wouldnt hold that large number at one time, so im trying to write a function that generates the sending method every three messages or something.

Does anybody know of a suitable function? Sample code? Or a way to refresh an extjs form every few seconds/minutes/etc?

VDP
  • 6,340
  • 4
  • 31
  • 53

1 Answers1

0

Not sure that's the best approach. But for refreshing a page it's basic javascript

document.location.reload(true)

and use a setTimeout to repeat the reload.

So a reload afther 5 seconds:

var t = setTimeout(function(){document.location.reload(true)}, 5000);

But I rather advice using an ajax call and a setInterval to repeat every x ms so you wouldn't have to reload any page at all!

An even cleaner approach is to handle it on the backend.

Another helpful article

Another helpful article

Community
  • 1
  • 1
VDP
  • 6,340
  • 4
  • 31
  • 53
  • @HashimSerag Btw welcome to StackOverflow ;) If you like an answer [you can accept it](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) and/or upvote it. If you have additional questions you can edit your answer or post it in comments. Glad I could help. – VDP Aug 14 '12 at 08:36
  • im really sorry im new ur right =)), i really like ur answer, i made it the ajax way n it was so helpful thank u so much, i've been working on it since i asked the question until now lol, thank u – Hashim Serag Aug 14 '12 at 11:53
  • 2
    You might also wish to check out [Ext.TaskManager](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.TaskManager), but as VDP suggested, I really don't think giving this task to a client javascript is a good thing - your backend should really do it using a queue / cron. – Izhaki Aug 14 '12 at 23:31