Link to Mobile Panel

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Hi - I'm trying to get a link to a specific panel within a mobile page - something like this:

/apex/ui?page=test&main_panel=detail&id=a0H11000008k1GF

Is this possible ?
Photo of Simon Parker

Simon Parker

  • 420 Points 250 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Simon Parker

Simon Parker

  • 420 Points 250 badge 2x thumb
Here's the solution I came up with:

(function(skuid){
	var $ = skuid.$;
	
	skuid.events.subscribe('skuidMobileReady',function(){

	    var eventid = getURLParameter('id');
	   
	    if (eventid !== null){
	    
            var m1 = skuid.model.getModel('SelectedEvent');
             var currentEventCondition = m1.getConditionByName('currentEvent');
             m1.setCondition(currentEventCondition,eventid);
             m1.updateData();
             var HideCardEditSnippet = skuid.snippet.getSnippet('hidecardeditsnip');
             HideCardEditSnippet();
             skuid.mobile.setMainPanel('Detail');
	    }
	});
	
})(skuid);

function getURLParameter(name) {
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(//g, '%20'))||null;
}

Seems to work fine - at this point I'm just re-directing to a specified panel - 'Detail' but this could easily be modified to switch to a panel named as a parameter.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad you were able to work this out.  I was going to answer saying this wasn't possible. But you have proved me wrong...