Jump to content

Lister - buttons are being duplicated


cryostar
 Share

Recommended Posts

I created a PW module for a new admin page and I have set some buttons and a lister in an execute.php file:

<div>
    <a class="ui-button" href="./upload-batch-record">Upload batch</a>
    <a class="ui-button" href="./export-filtered">Export filtered result</a>
    <a class="ui-button" href="./generate-template">Generate CSV Template</a>
    <a class="ui-button" href="<?= $addUrl ?>">Add New</a>
</div>
<hr class="uk-divider-small" />
<?= $table ?>

Though to my surprise, Lister is also generating these buttons on top of the table like this:

image.thumb.png.0da1f3d22eb6b2eff81d2b995495a38d.png

What can I do to prevent this?

Link to comment
Share on other sites

The answer lies in my ___execute method in my module file.

I should return the lister only if it's an AJAX request. So I was able to do it with:

if($this->config->ajax) return $lister->execute();

return array(
	'table'=>$lister->execute()
);

under ___execute

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...