Author Topic: Reload message_list  (Read 3060 times)

Offline unicorn

  • Jr. Member
  • **
  • Posts: 15
Reload message_list
« on: January 17, 2011, 10:53:56 AM »
Hello,

can I reload message_list via command "list" without loosing of selected message in preview frame?

We have extra column in message_list and we need reload this list time to time.

Now when I run rcmail.command('list', rcmail.env.mailbox); then preview frame is reloaded with default watermark.html.

Thank you for suggestion.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Reload message_list
« Reply #1 on: January 18, 2011, 02:21:39 AM »
i think what you need to do is get the current selection first....

Quote
cur_sel = rcmail.message_list.get_selection();

then reload the list and then reapply the selection

Quote
if (cur_sel) {
   for (var i in cur_sel)
      rcmail.message_list.select_row(cur_sel, CONTROL_KEY);
}
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline unicorn

  • Jr. Member
  • **
  • Posts: 15
Reload message_list
« Reply #2 on: January 18, 2011, 08:15:18 AM »
Thank you JohnDoh for your answer, it's useful for me.