Connect pageSize and pageSelection - activatedRoute - angular-activatedroute

0
I have a little problem with the Pagination - Cities quest.
I have navbar-with-selection with page and with pageSize.
When I select pageSize: 5, the pages resize correctly (so on the last page in this case, page 16, only 2 cities remain).
PageSize works but "once" when I click on 5 or 10 or 15, but when I change the page pageSize immediately changes back to 5.
enter image description here
enter image description here
How to switch to valueChanges and router.navigate using side effect (tap operator)

Related

How to disable cache for ag-grid when paging to previous pages

I'm using ag-grid with server-side row model and pagination, just the previous and next buttons, no scrolling. I want ag-grid to load data (so calling getRows()) on every click to next and previous.
It works fine for next page but the data for previous page is never loaded again from server.
I'm using this config properties for pagination and cache:
rowModelType: 'serverSide',
pagination: true,
paginationPageSize: 10,
cacheBlockSize: 10,
maxBlocksInCache: 0
More or less completely disabling cache on client side. Any hint how to accomplish that?
Here is your solution:
maxBlocksInCache = 1;
cacheBlockSize - should be the same as paginationPageSize (cuz it would one visible 'scope' - for block storage, so remember to bind it to one property) and then - block storage is a maxBlocksInCache - should be the one only (cuz one visible block is equal to one block in cache)
rowModelType: 'serverSide',
pagination: true,
paginationPageSize: 10,
cacheBlockSize: 10,
maxBlocksInCache: 1
Demo

How to show more element of number picker list in flutter?

I used this for developing a number picker for my flutter application but it shows only three element of list of numbers in number picker . I want to show more element(for example 7) and beside, I want the selected element be exactly the middle element (in my case 3 element before and three after) which part of the library code should be changed?
When just changing "_listViewHeight = 3 * itemExtent", in library we see the problem I mentioned in image below. First the selected Item is not the middle one beside the maximum value can not be selected.
I had this same problem and was able to get it working for odd display number lengths of 3 or greater after digging into the numberpicker code and making some changes. Here is a diff of the changes I made. This is working for me using my repo. You can also just copy the lib/numberpicker.dart file from my repo into your project and include that file. Hopefully will get this pulled into the numberpicker project at some point. Below is my example use for 7 numbers displayed at a time:
NumberPicker.horizontal(
initialValue: _currentValue,
minValue: 1,
maxValue: 10,
numberToDisplay: 7,
onChanged: (newValue) =>
setState(() => _currentValue = newValue));
and scrolled to the first number
you can pick a different odd number for the numberToDisplay parameter such as 5
and removing the parameter will use the default of 3.
More info here
At here and here
Change
_listViewHeight = 3 * itemExtent,
to
_listViewHeight = noOfElements * itemExtent,
where noOfElements is the number of elements you want to display.

Two different page numbers, first set without the first page number

I can't seem to get how to do this, I need two sets of page numbers, the first set starts from i, ii, iii etc. The second set starts from 1, 2, 3, etc. For the first set, page i should not show the i, but page 1 should show the page number. If I removed the page i number, then page 1 also vanishes, anyone know how to handle this?

Jssor Slider GoTo() for Thumbnails

First of all: Great Plugin. Thank you!
1) For any slider with thumbnails for example Image Gallery), when selecting a specific thumbnail, it appears to use PlayTo().
How would I use GoTo() - instead of PlayTo() - for all thumbnails, to display the full slide for that thumbnail?
2) What is $Align as it applies to ThumbnailNavigatorOptions or Slider Options?
3) What is $Steps as it applies to ArrowNavigatorOptions?
Thank you.
Re 1: Use GoTo() instead of PlayTo()
Please set $SlideDuration to 0
Re 2: What is $Align?
$Alignspecifies the position that the current slide aligns its left side to 'slides' container. It applies to both 'Slider Options' and '$ThumbnailNavigatorOptions'.
Re 3: $Steps for $ArrowNavigatorOptions
It means steps to go for each navigation request.
e.g. given the value of $Steps is 3, when you click the 'right' arrow, it will go through 3 slides.

iTextSharp: Is there a way to override hard page numbers in a PDF?

I have a document with a cover page, a table of contents, and then the actual content. The first page after the table of contents is numbered "1" in the footer.
Say the document has 130 pages, 128 pages of actual content aside from the cover and TOC. I want my audience to be able to go to the top of the adobe reader and see 1/128 rather than 1/130. When they enter 1, or 2 etc in that box, it jumps to page 1 or two of the actual content (rather than the cover page or the TOC). Is this possible?
You might get the results you're after with "Page Labels".
PdfPageLabels labels = new PdfPageLabels();
// label the first two pages "i" and "ii"
labels.addPageLabel( 1, PdfPageLabels.LOWERCASE_ROMAN_NUMERALS );
// label the following pages "1, 2, ..."
labels.addPageLabel( 3, PdfPageLabels.DECIMAL_ARABIC_NUMERALS );
myPdfWriter.setPageLabels( labels );
You can also give each page a unique string rather than page numbers:
labels.addPageLabel( pageNum, PdfPageLabels.EMPTY, pageNameStr );
I see "Page 1" in the text entry field, with (1 of 3) in the gray text next to it. I don't think you can change the "of N", just that first part.
Warning: I just discovered that the page "number" dialog in Acrobat X is limited to 8 characters. Any label longer than that is impossible to enter.