how to load a page with GET parameters in grid expander? - atk4

As you know we can load a Page in expander in this way:
$g->addColumn('expander','tickets');
But in my situation, the Tickets page have some parameters like this:
?page=tickets&tid=1
how can I load this page with tid parameter?

Make those parameters sticky at the start of your page:
$this->api->stickyGET('tid');
This parameter will be passed to sub-pages.
See also:
https://github.com/atk4/docs/blob/master/application/routing/sticky.md

Related

To show different list page for different profile

I have two vf pages, say vf1 and vf2, which have standard controller for same object say Leads. Now i want to show vf1 page for edit button for any profile1 and and vf2 page for profile2 on edit button.
Tried to see any option in Profile menu, but not able to find anything for page assignment for list/edit/create/...etc. for an object.
There is no such feature in Salesforce to allow visualforce page assignment per profile.
I would recommend below
1.Create a hirerachy custom setting to store the mapping between the vf page and the profile .
2.Write a vf that will be assigned for all profiles but on action (called upon where page loads) it will look into the hirerachy custom settings map and takes the user to right visualforce page .You can pass along page parameters as query parameters .

Change page without changing location.path or location.url

Is it possible for AngularJS to change your page without changing your location path/url?
Like for instance I have a table page that has the path/url <host>/<app>/table and when I click on the entry in the table, it goes to an element detail page but the path/url stays the same (since this operation is confined anyway to the /table path) ?
you can always use ng-include to load a template on a specific part of your page.
that would change the content of that part without changing the url of the page.

AngularJS - using Angular UI router - how to fetch the next content via AJAX without removing the current content

I'm using Angular UI router in my app. This is what I'm doing.
A main view contains a child view and a div container for "pagination"
By default, initially, a first set of contents is loaded
When a user clicks on "next page", next set of contents is loaded (with the URL also being changed to /content/2 (where 2 indicates the next page number)
All is working well, but each time the contents are loaded, it goes "blank" before it loads. So it seems like it's reloading the view (which is obvious).
What I would like to do is reload the content without having that "blank" page. How can I achieve this?
At first thought, I think you could you the same approach as infinite-scroll, which is what I'm using. So you make a GET request to the server to get new content and push it to the list on clicking 'next'. However, since the URL changes also. This will cause the controller to be reloaded. You can actually bypass this by setting reloadOnSearch to false.

Single Page website with CakePHP

I'm currently working on a single-page scrollable website (5 pages displaying as a single page) using CakePHP. I have worked on each controller action and everything runs well. I have one layout for the entire app and a view for each action. My challenge is finding a way to load the view of each action without reloading the page inside the layout. Should I just put all the view content inside the layout (without echoing $content_for_layout) or could there be a better way to do it?
Considering the div you want to update has the id #content:
$.ajax({
url:"http://yourdomain.com/controller/action",
context:document.body,
dataType:"html",
data:{id:123}, // in case you need to pass some params
success:function(data){
$("#content").html(data);
}
})
The action must return the HTML you want to display inside that div. If you want to have each pags loaded in different div's, you will have to create one div for each page and call AJAX for each one.
When the page is loaded for the first time, you can just pull the data for whatever default action you defined. Then, when you want to change the content, just call AJAX.

Put custom links outside weblinks section

How can I put custom links outside the web links section in a salesforce page?
Or is there a way I can create more than one weblinks section?
If not is there a way I can create a custom field that can call a javascript method ? (my custom links calls a js method that after validation will call a web service to do some work.)
I tried creating a custom field (formula) but I wasnt able to call a js function from there, or put some script.
What I want to do is spread my custom links I have in the weblinks section into different sections on the page.
I have used this method to override link and button actions in the past. You could use the same method for move elements around the page too.
Create a visualforce page and use it to override the standard page for the object you want to modify. The override page needs to use the standardcontroller for that object. You can use an extension controller for adding Apex functionality if necessary.
Use the detail tag to render the guts. Then put in a script tag to select the anchor links you want to move around the page. It will take some inspection with your browsers debugger to find exactly what you are looking for.
<apex:page StandardController="CustomObject__c" extensions="CustomObjectController" >
<apex:detail relatedList="false" inlineEdit="true" id="mydetail" />
<script>
// select your elements you want to move, edit or delete here
</script>
</apex:page>

Resources