Multiple MVCContrib Grid on 1 page - asp.net-mvc-2

I have multiple mvccontrib grids on 1 view page each w/ its own pagination. My problem is when I page 1 grid it pages the other 2 as well. Is there I can differentiate what grid is being called so only the 1 gets paged or are there any other work around for this

You could set the page query string parameter to different values on both grids:
#Html.Pager(Model.Collection1).QueryParam("page1")
#Html.Pager(Model.Collection2).QueryParam("page2")
or build the query string yourself:
#Html.Pager(Model.Collection1).Link(page => Html.ActionLink(page, "SomeAction", new { page1 = page, page2 = Request["page2"] }))
#Html.Pager(Model.Collection2).Link(page => Html.ActionLink(page, "SomeAction", new { page1 = Request["page1"], page2 = page }))

Related

ionic 3 from tabbed page to normal page

Pages structure is: Tabs(page1,page2,page3).
When I click a button within in page1, I want to go to page4,
but now we still can see tab, how to make page4 displays as a normal page and can back to tabbed page.
In page1, I use below line to go to page4
this.navCtrl.push(page4);
I think you could first try the following, which is for test only to understand
that this is achievable:
pass params to the ion-tabs like this:
<ion-tabs>
<ion-tab [root]="tabMap" [rootParams]="tabParams" tabIcon="map"></ion-tab>
<ion-tab [root]="tabList" [rootParams]="tabParams" tabIcon="list"></ion-tab>
</ion-tabs>
Prepare the params in the tabs.ts like this:
ionViewWillEnter() {
this.tabParams.parentNav = this.navCtrl;
}
So in the inner page (page1, 2, 3) you can retrieve it, place it in a variable e.g. parentNav, and when you want to navigate out of the tabs page to do a this.parentNav.push(page4).
The proper way I think is to use events events: ionic forum
So in the tabs.ts page you could have this piece of code:
events.subscribe('tabs:newPage', (page) => {
this.navCtrl.push(page);
});
And in each page, or in a service you could have:
newPage(page) {
console.log('navigate to a new page, not a tab')
this.events.publish('tabs:newPage', page);
}
What ionic is ?
If lazy loading,maybe ionic 3 , hod did you declare page4?
You have to push it like this : this.navCtr.push('page4');
If is all ok try this (it 's extracted form an app example) :
static get parameters() {
return [[IonicApp], [NavController], [ConferenceData], [UserData]];
}
constructor(app, nav, ...) {
// all of the constructor code
}
tourFunction() {
let nav = this.app.getComponent('nav');
nav.push('page4');
}
Ref

TYPO3 determine page type of menu item and wrap div with custom class around it

My goal is to apply different navigation logic to different page types. For example shortcut type will be container (drop down list in FE, shortcut itself is dummy link), standard type - page with content that you can navigate to. So, when in FE navigation user selects page:
drop-down list appears
if (type of page in list == standard)
can navigate to page in list;
else if (type of page in list == shortcut)
GO TO drop-down list appears
I know that you can do something like this:
lib {
main-nav = HMENU
main-nav {
1 = TMENU
1 {
expAll = 1
NO = 1
NO.wrapItemAndSub = <li>|</li>
NO.stdWrap.cObject = CASE
NO.stdWrap.cObject {
key.field = doktype
default = TEXT
default {
field = title
}
# standard page type
1 = TEXT
1 {
field = title
wrap = <div>|</div>
}....
As a result you get page title wrapped with div if page type is standard.
But what do i need to do to wrap whole menu item rather then just wrapping title?
If it's just about putting the div around the whole submenu, I guess what you already got should be applied to wrapItemAndSub instead
lib {
main-nav = HMENU
main-nav {
1 = TMENU
1 {
expAll = 1
NO = 1
NO.wrapItemAndSub.cObject = CASE
NO.wrapItemAndSub.cObject {
key.field = doktype
default = TEXT
default {
value = <li>|</li>
}
# standard page type
1 = TEXT
1 {
value = <li><div>|</div></li>
}....
I think you need to combine HTML, CSS and javascript.
In the typoscript you prepare the HTML with different markup depending on page type. Then your javascript has to handle the click event in case of a shortcut page where a click should open a drop down instead of going to that page. (add eventhandler)
So you need to give javascript something to identify the shortcut pages.
With the CASE object you mentioned you can build the apropiate HTML with all neccessary information (you might use data- attributes).
For a more detailed help you need to be more specific what you want to achieve.

TYPO3 Special Menu "Browse" - Entry Level

I'm stuck in a TS problem related to a special browse HMENU. I'm using TYPO3 7.6.11.
Site Structure:
/ Page 1
// Page 1.1
// Page 1.2
// Page 1.3
/ Page 2
/ Page 3
I'd like to integrate a Previous / Next navigation for the first navigation level. On Page 1, you can switch to Page 2. On Page 2, you can switch to Page 1 or Page 3. I used following code and it works on the first level:
lib.newsletter = COA
lib.newsletter {
10 = HMENU
10 {
special = browse
special {
items = prev
}
1 = TMENU
1 {
NO.ATagParams = class="prev"
}
}
20 < .10
20 {
special.items = next
1.NO.ATagParams = class="next"
}
}
When I open a page of the second level, I'd still like to browse on the first level. So when I'm on Page 1.2 and click on the "Next" button, "Page 2" should open.
I've tried to set an entry level in combination with a treeLevel condition but the entryLevel has no effect.
Do you have an idea? Your help is really appreciated.
Thanks in advance,
Tom
entryLevel won't work here because it's relative to the current page. You can however set .special.value to another page id to make it relative to that page. This property supports stdWrap so you can be creative with things like
.special.value.data = leveluid:1 (page in first level of the root line)
See TypoScript reference

Page browsing in typo3 using pi_list_browseresults()

I would like to set the number of links to browse the result pages in my
extension created with kickstarter. (Page1 Page2 Page3...).
The maximum number can be easily set (in this case to 4):
**$this->internal["maxPages"]=t3lib_div::intInRange($lConf["maxPages"],0,1000,4); **
But this will show me the first four links all the time, no matter on
which page I am. So say I have 7 result pages and I am already on page
four: I see "Page1 Page2 Page3 Page4".
Is there a possibilty to change
this dynamically.
So on Page 4 I see " Page2 Page3 Page4 Page5"
On Page 5 I see " Page3 Page4 Page5 Page6"
and so on?
I think what you are looking for is:
$this->internal['pagefloat']
It is defined like this:
Using $this->internal['pagefloat']: this defines were the current page is shown in the
list of pages in the Pagebrowser. If this var is an integer it will be interpreted as
position in the list of pages. If its value is the keyword "center" the current page will
be shown in the middle of the pagelist.
You can find more options and description in the doc header of function pi_list_browseresults (class tslib_pibase):
Line 425, http://doxygen.frozenkiwi.com/typo3/html/de/d1c/class_8tslib__pibase_8php_source.html
Check this link: http://www.typo3forum.net/forum/extension-modifizieren-neu-erstellen/55721-fe-userlisting.html.
The user has given the code using which he has successfully implemented pagination, like:
............
$this->internal['results_at_a_time'] = t3lib_utility_Math::forceIntegerInRange($lConf['results_at_a_time'], 0, 1000, 3); // Number of results to show in a listing.
$this->internal['maxPages'] = t3lib_utility_Math::forceIntegerInRange($lConf['maxPages'], 0, 1000, 2); // The maximum number of "pages" in the browse-box: "Page 1", 'Page 2', etc.
...........

Can't Get Multiple Charts (Google Visualization) on Multiple Tabs (GWT TabPanel)

I need to display an unknown quantity of tabs each with an unknown quantity of graphs (Google Visualizations). I have created "Tab" and "Graph" classes and Tab contains an ArrayList.
TabWrappers extends FlexTable and is currently empty. It's a place holder at the moment, but the behavior does not change if I use FlexTable rather than TabWrapper.
The code below, minus the section that adds Tab2 works perfectly for creating 1 tab populated with graphs. When adding the 2nd tab both tabs are displayed and named correctly but neither have graphs.
public class SomeClass {
...
DataTable data = response.getDataTable();
DataView result;
Options options = createOptions();
ArrayList<Tab> displayTab = new ArrayList<Tab>();
Tab t;
ArrayList<Graph> graphList = new ArrayList<Graph>();
Graph g;
t = new Tab();
g = new Graph();
result = DataView.create(data);
result.setRows(new int[]{0, 2, 4, 6});
g.setGraphType(new PieChart(result, options));
graphList.add(g);
g = new Graph();
result = DataView.create(data);
result.setRows(new int[]{1, 3, 5, 7});
g.setGraphType(new PieChart(result, options));
graphList.add(g);
g = new Graph();
result = DataView.create(data);
g.setGraphType(new PieChart(result, options));
graphList.add(g);
t.setTabName("Tab1");
t.setGraphs(graphList);
displayTab.add(t);
// Add a 2nd tab
t = new Tab();
t.setTabName("Tab2");
t.setGraphs(graphList);
displayTab.add(t);
TabWrapper tabWrapper;
for (Tab tX : displayTab){
int row = 0, col = 0, maxCol = 2;
tabWrapper = new TabWrapper();
for (Graph gX : tX.getGraphs()) {
col = tX.getGraphs().indexOf(gX) - (row * maxCol);
tabWrapper.setWidget(row, col, gX.getGraphType().asWidget());
if (++col == maxCol) {
row++;
}
}
tabPanel.add(tabWrapper, tX.getTabName());
}
...
}
When you use tabs in GWT, the panels held in each tab seem to be lazy loaded and aren't completely set up until the user clicks on each tab.
In particular, the tab containers will have zero widths and heights (the error logs will probably be giving an error about containers having zero width) so the graph drawing will fail and leave an empty space.
What you need to do (and is probably good practice anyway) is to lazy load the contents of the tabs too so that the graph is loaded only when the tab is fully set up. This can be done by removing the call the t.setGraphs(...) and adding a selection handler that does it instead:
tabPanel.addSelectionHandler(new SelectionHandler<Integer> () {
public void onSelection(SelectionEvent<Integer> event) {
// Pseudocode:
// n = event.getSelectedItem()
// t = displayTab[n]
// g = graphList[n]
// t.setGraphs(g)
}
});
so that graphs are added and drawn only when the tab is selected.
You'll probably also want to call
tabPanel.selectTab(0);
to force a selection of the first tab after the selection handler is in place.
I had the same issues that you describe and this resolved it.