p:ajax event for pagination of lazy p:dataTable

后端 未结 2 367
北恋
北恋 2021-01-13 03:02

I\'m having trouble finding an ajax event that will execute my javascript when my list is updated during lazy loading of my datatable. This javascript is responsible for upd

相关标签:
2条回答
  • 2021-01-13 03:30

    In primefaces 6.2, here is the full list of dataTable events.

    page
    sort
    filter
    rowSelect
    rowUnselect
    rowEdit
    rowEditInit
    rowEditCancel
    colResize
    toggleSelect
    colReorder
    contextMenu
    rowSelectRadio
    rowSelectCheckbox
    rowUnselectCheckbox
    rowDblselect
    rowToggle
    cellEditInit
    cellEdit
    rowReorder
    swipeleft
    swiperight
    tap
    taphold
    cellEditCancel

    from the docs: javax.faces.component.behavior.ClientBehaviorHolder.getEventNames()

    0 讨论(0)
  • 2021-01-13 03:40

    Its not specific for Lazy Loading :

    In order to run a js function upon pagination complete use the p:ajax event="page" (It might also work for changing the number of records on a page)

    Like this

    <p:ajax event="page" oncomplete="myJsFunction();"></p:ajax>
    

    Additional event types are

    page - On pagination.

    sort - When a column is sorted.

    filter - On filtering.

    rowSelect - When a row is being selected.

    rowUnselect - When a row is being unselected.

    rowEdit - When a row is edited.

    rowEditCancel - When row edit is cancelled.

    colResize - When a column is being selected.

    toggleSelect - When header checkbox is toggled.

    colReorder - When columns are reordered.

    rowSelectRadio - Row selection with radio.

    rowSelectCheckbox - Row selection with checkbox.

    rowUnselectCheckbox - Row unselection with checkbox.

    rowDblselect - Row selection with double click.

    rowToggle - Row expand or collapse.

    contextMenu - ContextMenu display.

    (Taken from primefaces user guide)

    0 讨论(0)
提交回复
热议问题