You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a query rather than an issue. It is actually quite an easy answer,.,.
basically I want to have the main panel to dynamically load data from the selected list item from the menu panel
So far I have a menu that contains list like so...
<li><a href='#main_model?make=Honda" data-panel='main'>Honda</a></li>
<li><a href='#main_model?make=Toyota" data-panel='main'>Toyota</a></li>
<li><a href='#main_model?make=Suzuki" data-panel='main'>Suzuki</a></li>
etc.
I would like it so whenever a person clicks on one of these links, it would update the main panel.
So far I can get the page to load the first time... however whenever a person would click on another item on the menu,
the script doesn't detect a page change as it's calling the same id "main-model".
So my question is how can I detect if a user has clicked on a menu item to trigger a page change?
and would it be better to parse the data through something like data-id
<li><a href='#main_model" data-id="Honda" data-panel='main'>Honda</a></li>
<li><a href='#main_model" data-id="Toyota" data-panel='main'>Toyota</a></li>
<li><a href='#main_model" data-id="Suzuki" data-panel='main'>Suzuki</a></li>
thanks
The text was updated successfully, but these errors were encountered:
from regular JQM changePage calls and links, so either of these three does not take parameters into account or they do and JQM doesn't, which takes over again after I'm done tweaking.
I'll have a look.
In the meantime, if you want to detect clicks, just
$(document).on('click', 'a.give_your_links_a_class', function(e, data){
console.log("clicked");
// get the href from the link clicked
// use $.mobile.path.parseUrl( href ) to get the parameter ("search") component
})
I'll write back on parameters.
PS: your second example using data-id... not sure if that works. Since the page is in the DOM already, JQM by default does nothing.
PSS: also have a look here on dynamic page creation in JQM.
PSSS: Pageparam plugin
Hi Frequent,
First of all, great work with multiview!
This is more of a query rather than an issue. It is actually quite an easy answer,.,.
basically I want to have the main panel to dynamically load data from the selected list item from the menu panel
So far I have a menu that contains list like so...
<li><a href='#main_model?make=Honda" data-panel='main'>Honda</a></li>
<li><a href='#main_model?make=Toyota" data-panel='main'>Toyota</a></li>
<li><a href='#main_model?make=Suzuki" data-panel='main'>Suzuki</a></li>
etc.
I would like it so whenever a person clicks on one of these links, it would update the main panel.
So far I can get the page to load the first time... however whenever a person would click on another item on the menu,
the script doesn't detect a page change as it's calling the same id "main-model".
So my question is how can I detect if a user has clicked on a menu item to trigger a page change?
and would it be better to parse the data through something like data-id
<li><a href='#main_model" data-id="Honda" data-panel='main'>Honda</a></li>
<li><a href='#main_model" data-id="Toyota" data-panel='main'>Toyota</a></li>
<li><a href='#main_model" data-id="Suzuki" data-panel='main'>Suzuki</a></li>
thanks
The text was updated successfully, but these errors were encountered: