Michael Iverson
Posts: 0
Joined: Tue Dec 31, 2013 6:22 pm

Nested Panels

A couple of days ago, I finished working on the panel tutorial, and it worked great. I have been working lately on making a nested panel. For example, I have one button in the first panel, that once the user click on it, another panel, on the same side, will appear. Is there any way to attack this? I am stuck.

Thanks

Michael

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Nested Panels

Hello! Not sure I understand what do you mean. Have you tried new Panel component http://docs.appery.io/documentation/u...?

Michael Iverson
Posts: 0
Joined: Tue Dec 31, 2013 6:22 pm

Nested Panels

Yes,

Code: Select all

 However,  Let's say I add a button to the panel.  This button will open a new panel, on the same side. 

Michael

Michael Iverson
Posts: 0
Joined: Tue Dec 31, 2013 6:22 pm

Nested Panels

Yes,

However, Let's say I add a button to the panel. This button will open a new panel, on the same side.

Michael

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Nested Panels

You can add action of panel opening on button click. This panel will close, but new one open.

Michael Iverson
Posts: 0
Joined: Tue Dec 31, 2013 6:22 pm

Nested Panels

Image

When you click the 'New Panel' button, a new panel will be loaded in place of the old. I cannot figure out the code to do this. Below is my attempt to do this with js/jquery:

precode
var Panel = function() {
var that = {},
_panel = $('#mypanel');

Code: Select all

 var page = _panel.parents("[data-role=page]"); 
 page.append(_panel); 

 if (_panel == $('#mypanel')) { 
     _panel.on("panelbeforeopen", function(event, ui) { 

         $("#close_panel").die().live("click", function() { 
             that.close(); 
         }); 
         $("#new_panel").on("click", function() { 
             that.change(); 
         }); 
     }); 
 } else if (_panel == $('#mypanel2')) 
 { 
     _panel.on("panelbeforeopen", function(event, ui) { 

         $("#close_panel").die().live("click", function() { 
             that.close(); 
         }); 
     }); 

 } 

 that.open = function() { 
     _panel.panel('open'); 
 }; 
 that.close = function() { 
     _panel.panel("close"); 
 }; 

 that.change = function() { 
     _panel.empty().remove(); 
     _panel = $('#mypanel2'); 
     page = _panel.parents("[data-role=page]"); 
     page.append(_panel); 
     _panel.panel('open'); 
 }; 
 return that; 

};
/code/pre

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Nested Panels

Hi Michael,

Try our new component that is much more easier and you won't need any JS: http://docs.appery.io/documentation/u...

Return to “Issues”