Yii2 pjax pagination not working well in modal pop up - pagination

I stuck in the condition where I clicked on the modal pop-up's grid view pagination link, modal pop up gets closed and shows further records in browser tab.
I got the answer by adding renderAjax($viewPath) instead of renderPartial($viewPath). It works for me but now when I click on pagination, first time works but second time it doesn't work. I saw in console.ajax call is making but response not showing in modal popup.

You should put the pagination code outside the Pjax.
<?php Pjax::begin() ?>
// code here
<?php Pjax::end() ?>
<?php echo \yii\widgets\LinkPager::widget([
'pagination' => $pages,
'options' => ['class' => 'pagination']
]); ?>
Hope that helps.

Related

duplicated menu module in joomla

I have a bottom menu module in my joomla CMS which works fine in footer 1 position. However, when I try to create another menu module in the footer 2 position. it assigns the same articles to this menu item as my first one?
You go to folder "template/{name of template}" and open file "index.php". Then create new module menu footer:
<?php if ($this->countModules('footer_menu')): ?>
<jdoc:include type="modules" name="footer_menu" style="none" />
<?php endif; ?>
After that, you go to backend and config position.

Customization of Navigation menu in Wordpress

I'm new in Wordpress. I run the wordpress using xampp. Themes have a limited navigatiob menu, and I want to add two to four navigation menus with sub-menus in my theme. How can I do that? What file should I edit to add some navigation menus?
Please help me.
Thank you!
In your theme functions.php you should register the menu location by adding the following code:
register_nav_menus(
array(
'menu_1' => 'Menu name #1',
'menu_2' => 'Menu name #2'
)
);
For more instruction about the register_nav_menus() function you can visit the related codex.
Then in your theme files, you should use the following code:
wp_nav_menu(
array(
'menu' => 'menu_1'
)
);
For more instructions about the wp_nav_menu() function you can visit the related codex.
Finally, the sub menu items can be manipulated from within the WordPress dashboard. You can see this video for more information.
<?php register_nav_menu( 'menu-id-1', 'Menu Label1' ); ?>
<?php register_nav_menu( 'menu-id-2', 'Menu Label2' ); ?>
<?php register_nav_menu( 'menu-id-3', 'Menu Label3' ); ?>
put this in your 'functions.php' file

Zend framework 2 - Add a subview in layout?

I have three layout views for render my web page (one for logged users, other for unlogged users and one for admin users).
These layouts have the same footers section. This footer is very complex and I'd like centralizing changes to a single footer view.
How I can add a subview inside the layout view, such that the layout will have the following code for rendering the content returned by actionControler?
<?php echo $this->content; ?>
And the following code, but this is always same template and isn't returned by the actionController:
<?php echo $this->footer; ?>
Do I have to modify onBootstrap method?
If the footer itself is simple you should be able to use the Zend\View\Helper\Partial helper to render a phtml file. To do this (inside your layout):
<?php echo $this->partial('view path'); ?>
If the footer requires some logic, it maybe best to look at creating a view helper.

jQuery Mobile how to dynamically add html to dialog box

I am looking to open a dialog from a specific page and load dynamic data into the dialog.
On the main page I have a number of different links that when clicked provides more information on that link. All the data I have for that link is included on the main page. Somehow I would like to assign the dialog so that it is populated when the dialog opens.
I've tried something like this so far:
<?php foreach($offers as $offer) : ?>
<?php echo $offer->{'offer_name'}; ?>
<?php endforeach; ?>
Then I have an event catcher to catch the link click and then load the "data-desc" meta into the dialog but this doesn't work.
$('.offer').live('click', function(){
var data = $(this).attr('data-desc');
$("#data-desc").html(data);
$("#dialog-offer").dialog("open");
return false;
});
<div data-role="content" id="dialog-offer">
<p class="data-desc"></p>
</div>
I have been looking for an example on how to do this in jQM. This is such a basic necessity for jQM in general that I am surprised that I cannot find any examples. Could someone point me in the right direction. Thanks for the help.
You have a number of errors in your code:
You have given the id="dialog-offer" to a <div> with data-role="content". You should wrap that div in another div with data-role=page
You don't necessarily need to use $("#dialog-offer").dialog("open");. Just set <a href='#dialog-offer'>
You have the wrong selector for the html() call. The class name of the <p> is what you're using with an id-style selector
I have rewritten the code and posted it here: http://jsfiddle.net/PBb3h/
Not exactly like yours, but it does what you want.

Pagination on Propel ORM

i paginated the propel results, its all working fine, but i cant get this thing working. I will really appreciate any help or workaround this issue:
<?if ($posts->getPage()==???) { ?>
next
<?}?>
the function getPage() returns to me the active page, but what should i put on the ??? to hide the last next link on propel, some function like $posts->getLastPage() that actually works. I just cant get any info about this on the Propel documentation.
to hide the first 'previous' link, i used this:
<?if ($posts->getPage()>1) { ?>
prev
<?}?>
getLastPage() will return the page number of the last page. atLastPage() is a convenience function that will already do the comparison for you, and also exists as atFirstPage(). See the API docs for Propel 1.3, 1.4, 1.5 or 1.6.
You code could look like this:
<?php if (!$posts->atLastPage()) { ?>
next
<?php } ?>
I assumed $linkPrevNext contains just the page numbers, like it came from $posts->getNextLinks(). If not, you should not use getLastPage() in the link of course.

Resources