1

ExtJS 4.2 でレコードが読み込まれているため、グリッドを読み込んで更新しようとしています。残念ながら、UI をレンダリングする前にすべてのレコードが読み込まれるまで while (i--) が待機するタイトなループで、基本的にブロックされます。スピナーが 1 分間回転するため、ロードするレコードが大量にあるため、各レコードをロードするときに UI をレンダリングする必要があります。

リフレッシュをトリガーしてそれらを1つずつロードし続ける方法はありますか..または2秒間隔でリフレッシュをトリガーする方法はありますか? または10レコードごと..

これが私のコードです:

// In the parent function:

while (i--)
{
  gr.l('ao', 'Running pool');
  me.drawCell(store, rList[i]);
  // need to refresh the grid at this point ..
  // printing console.log outputs but UI is not refreshed ..
}


// The function which does the adding to the store ..

drawCell: function (store, roster)
{
  var me = this;
  if (!roster)
    return false;

  // fix the common issues
  firstName = roster.firstName ? roster.firstName : roster.userId;
  lastName = roster.lastName ? roster.lastName : '';
  companyName = roster.companyName ? roster.companyName : '';
  phoneNumbers = me.localStore.getPhoneNumbers(roster);
  userId = roster.userId;

  // add to list
  store.add(
  {
    firstName: firstName,
    firstNameGroup: firstName.charAt(0).toUpperCase(),
    userId: userId,
    lastName: lastName,
    companyName: companyName,
    iconCls: 'avatar-' + userId,
    status: (roster.status == 'offline') ? 'offline':roster.status,
    locationStatus: 'office',
    locationStatusDetail: 'Office',
    icon: me.getAvatarUrl(userId),
    systemMetadata: roster.systemMetadata,
    middleInitials: roster.middleInitials,
    userMetadata: roster.userMetadata,
    statusGroup: me.getStatusGroup(roster.status),
    group: (roster.systemMetadata && roster.systemMetadata.tags && 
  });

}、

4

1 に答える 1