1 Reply Latest reply on Jul 14, 2007 4:59 AM by Mitek17

    Why doesn't a List update it's display when you change the dataprovider Array?

    MaxMuld Level 1
      Hi. I have a list and an array with more strings inside. If i remove some of the strings from the array and add some new strings then the list display doesn't update. How can i force the list to update?

      List1.dataProvider = Array1;
      Array1.pop();
      Array1.push("test");
      List Update??????
        • 1. Re: Why doesn't a List update it's display when you change the dataprovider Array?
          Mitek17 Level 1
          Hi MaxMuld,

          Because it has to be ArrayCollection, not the Array. Documentation about Datagrid.dataProvider says that Array as provider will be converted to ArrayCollection. And ArrayCollection performs all the notifications if you add/delete items in it.

          If you still want to use Array you should do the following:
          var ar= new Array();
          ar.push(x)
          grid.dataProvider = ar;

          grid.dataProvider = new Array();
          ar.pop();
          grid.dataProvider = ar;

          But this is very inefficient.

          Dmitri.