dark_mode EN
  • Event WPagination :OnPageChange
  • Parameters
    JsEvent

  • Return value
    NIL

Event that occurs every time the page is changed in the control. To retrieve the value of the page that was clicked, you must access a member of the Hash 'hEvent' that receives the control named 'detail-value'.

Example:

METHOD PageChange( hEvent ) CLASS WDocMain
 LOCAL oItem
 LOCAL cPage := HB_HGetDef( hEvent, "detail-value", "" )
IF Val( cPage ) > 0
    ::nPage := Val( cPage )
 ELSEIF cPage == "chevron_left"
    ::nPage := Max( 1, ::nPage - 1 )
 ELSEIF cPage == "chevron_right"
    ::nPage := Min( 10, ::nPage + 1 )
 ENDIF
FOR EACH oItem IN ::oPag:aItems
    oItem:lActive := ( oItem:nPage == ::nPage )
 NEXT
 ::Filter()
RETURN nil

Previous chevron_left Next chevron_right