Prado\Collections\TPagedList::onFetchData PHP Метод

onFetchData() публичный Метод

This event is raised each time when the list changes to a different page and needs the new page of data. This event can only be raised when {@link setCustomPaging CustomPaging} is true.
public onFetchData ( $param )
    public function onFetchData($param)
    {
        $this->raiseEvent('OnFetchData', $this, $param);
    }

Usage Example

Пример #1
0
 public function testOnFetchData()
 {
     $list = new TPagedList(array(1, 2, 3, 4));
     $list->CustomPaging = true;
     $list->PageSize = 2;
     $list->gotoPage(0);
     $myList = new MyPagedList();
     $list->attachEventHandler('OnFetchData', array($myList, 'fetchData'));
     self::assertEquals(false, $myList->hasFetchedData());
     $list->onFetchData(new TPagedListFetchDataEventParameter($list->CurrentPageIndex, $list->PageSize * $list->CurrentPageIndex, $list->PageSize));
     self::assertEquals(true, $myList->hasFetchedData());
 }