Hide Primefaces datatable 'No Records Found' while loading the table content

后端 未结 2 1946
甜味超标
甜味超标 2020-12-21 10:47

In my application im loading my data table with default values which placed in first page(After Logged in).while loading data,data table prompts \'No Record Found\' which is

2条回答
  •  遥遥无期
    2020-12-21 11:03

    Not Tested

    I suppose you got some button that is being clicked prior to loading data of the table

    so you can add jquery command to hide the row that holds the message for the empty message to its onclick attribute like this

    onclick="jQuery('#YourFormIdOrYourTableId .ui-datatable-empty-message').hide();"
    

    you can than

    put the line back to visible with jQuery('#YourFormIdOrYourTableId .ui-datatable-empty-message').show();

    alternatively, if you are using primefces button you can try

    onstart="jQuery('#YourFormIdOrYourTableId .ui-datatable-empty-message').hide();"
    
    onsuccess="jQuery('#YourFormIdOrYourTableId .ui-datatable-empty-message').show();"
    

    calling to the .show() upon success is for enabling the table to display the empty message next time when the table will be empty...

提交回复
热议问题