Skip to main content
added 6 characters in body
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

Please check out this workaround which is working for me:

public static forceListViewUpdate() {

 public static forceListViewUpdate() {

    try {
      let modules = (window as any).require.s.contexts._.defined;
      for (var p in modules) {
        if (modules.hasOwnProperty(p) && modules[p] && modules[p].itemInvalidator) {
          let itemInvalidatorKey = modules[p].itemInvalidator;
          let rootEl = document.getElementById('appRoot');
          let rootVM = (window as any).__ko.dataFor(rootEl);
          let itemInvalidator = rootVM.resources.consume(itemInvalidatorKey);
          itemInvalidator.invalidateCurrentItemSet();
          break;
        }
      }
    } catch (e) {
      console.log('Unable to update ListView:', e);
    }

      }

If you like, check the source here.

Please check out this workaround which is working for me:

public static forceListViewUpdate() {

try {
  let modules = (window as any).require.s.contexts._.defined;
  for (var p in modules) {
    if (modules.hasOwnProperty(p) && modules[p] && modules[p].itemInvalidator) {
      let itemInvalidatorKey = modules[p].itemInvalidator;
      let rootEl = document.getElementById('appRoot');
      let rootVM = (window as any).__ko.dataFor(rootEl);
      let itemInvalidator = rootVM.resources.consume(itemInvalidatorKey);
      itemInvalidator.invalidateCurrentItemSet();
      break;
    }
  }
} catch (e) {
  console.log('Unable to update ListView:', e);
}

  }

If you like, check the source here

Please check out this workaround which is working for me:

 public static forceListViewUpdate() {

    try {
      let modules = (window as any).require.s.contexts._.defined;
      for (var p in modules) {
        if (modules.hasOwnProperty(p) && modules[p] && modules[p].itemInvalidator) {
          let itemInvalidatorKey = modules[p].itemInvalidator;
          let rootEl = document.getElementById('appRoot');
          let rootVM = (window as any).__ko.dataFor(rootEl);
          let itemInvalidator = rootVM.resources.consume(itemInvalidatorKey);
          itemInvalidator.invalidateCurrentItemSet();
          break;
        }
      }
    } catch (e) {
      console.log('Unable to update ListView:', e);
    }

      }

If you like, check the source here.

Source Link
Alberto S.
  • 843
  • 8
  • 22

Please check out this workaround which is working for me:

public static forceListViewUpdate() {

try {
  let modules = (window as any).require.s.contexts._.defined;
  for (var p in modules) {
    if (modules.hasOwnProperty(p) && modules[p] && modules[p].itemInvalidator) {
      let itemInvalidatorKey = modules[p].itemInvalidator;
      let rootEl = document.getElementById('appRoot');
      let rootVM = (window as any).__ko.dataFor(rootEl);
      let itemInvalidator = rootVM.resources.consume(itemInvalidatorKey);
      itemInvalidator.invalidateCurrentItemSet();
      break;
    }
  }
} catch (e) {
  console.log('Unable to update ListView:', e);
}

  }

If you like, check the source here