ichynul/iframe-tabs

When Edit/Preview row in table, will not make a new pop up

Opened this issue · 9 comments

When I try to make a new query it will show new pop up:
https://imgur.com/a/Z0I93uY

But when I tried to edit or preview the query, it will load a new window, that's why I do not remove the Action button:
https://imgur.com/a/fqdPz2a

that I'm using for my grid actions:
$grid->setActionClass(ContextMenuActions::class);

The host https://imgur.com blocked in china,I use a vpn to visit it, I see them finaly.
You can see config/admin.php to contrl it.
extensions.iframe-tabs:

[
    //....
    'bind_urls' => 'popup', //[ popup / new_tab / none]
    'bind_selecter' => '.box-body table.table tbody a.grid-row-view,.box-body table.table tbody a.grid-row-edit,.box-header .pull-right .btn-success',
]

If you do not need use pupup for action buttons , set bind_urls to 'none'.
If you need bind other buton an pupup click event , you can add a class for the button : class="mybtn" and then add mybtn into to bind_selecter .(support in version 1.2.28)
Or you can jsut bind a click event on button onclick="top.openPop('url','title')"/onclick="top.openTab('url','title')".

That 'bind_urls' => 'popup' already but it's not working for this button:
https://imgur.com/a/wRS5kcI

The only button Create that's open a new pop up like this:
https://imgur.com/a/rKxo6Bk
to this:
https://imgur.com/a/Z0I93uY

And this is the code rendered from Inspect Element:

This is not work:
<a href="http://127.0.0.1:8001/admin/data/costumers/50/edit">Ubah</a>

This is work:

<a href="http://127.0.0.1:8001/admin/data/costumers/create" class="btn btn-sm btn-success" title="Baru">
	<i class="fa fa-plus"></i><span class="hidden-xs">&nbsp;&nbsp;Baru</span>
</a>

EDIT

When I tried to change again the action button to normal, it still the same, that only create button work for pop up, and not for Edit/View.

I tried to change 'bind_urls' => '...' to new_tab it will open a new tab and if we try to access button List from Create button, it will load a list table not closing the tab and if we try to click again the create button it will open new tab with Order-create-create-....

If 'none' it will work as normal.

if 'popup' it will do the same like 'new_tab' but not closing the popup too

Sorry, I can't upload an image right now to github

Update this extension to the newest version , then <a class="pupop" href="someurl">mylink<a/>,this will open a popup window for url someurl.
And you also can do like this <a onclick="top.openPop('someurl','mylink')">mylink<a/>.

Update this extension to version 1.2.30 , I tested, it is working .
<a class="pupop" href="someurl">mylink<a/>.

Just updated the version to the latest one 1.2.30

And it still not working, for default action button and custom button too.

I tried using this:
$form->html('<a class="popup" href="/admin/data/orders">mylink</a>.');

and it will load the current pop-up in LIST TABLE

update to 1.2.31.

And I tried to inspect element the class of CREATE BUTTON and apply it to the custom button and it still not working. But how Create Button can open a new pop up like this gif

Video related to this issue and #34
https://imgur.com/a/8hSOvoz

Button source in video:
$form->html('<a class="popup" href="/admin/data/orders">mylink</a>');

bind_urls recommend to use in $grid.

$grid->column('colmun', 'label')->display(function () {
            return '<a popw="600px" poph="600px" href="someurl" class="popup"><i class="fa fa-comment-o"></i></a>';
        });
//or
$grid->actions(function ($actions) {
            $actions->prepend('<a popw="600px" poph="600px" href="someurl" class="popup"><i class="fa fa-comment-o"></i></a>');
        });

If you use if in '$form', recommend to use click event instead:
<a onclick="openPop('someurl','mylink')">mylink<a/>,
<a onclick="top.openPop('someurl','mylink')">mylink<a/>,
<a onclick="top.openTab('someurl','mylink')">mylink<a/>,

Now the click event instead link it's working to open a new popup, but it will get loop like this
https://imgur.com/a/RvhykgN

And the action button still not working open new pop up