How to do dynamic paging in Grid.MVC - grid.mvc

I have using grid.mvc control in my project. I want to use dynamic paging in grid.mvc control.
I have combobox having entries 10,25,50. when I change comboBox value. Grid should display data accordingly. ( E.g. when I select 25, grid will show 25 rows). by deafult grid is showing 10 rows at a time.
Also it should adjust while filtering records.
I tried but didn't found any suitable solution.

This in theory should be pretty easy though I haven't done it myself.
You can link that dropdown (in the view) to an action result (in the controller) that changes a value you pass to the ViewBag (in controller ViewBag.WhateverName = dropdown's value).
Then re-render the same view and in the place when you end your grid, end it with
}).WithPaging(ViewBag.WhateverName)
Basically .WithPaging(10) would give you pages with 10 rows, WithPaging(20) 20 rows per page, etc. So by changing that value with the dropdown and registering that action in the controller to reassign the value, you should be able to achieve this functionality.
I will keep editing and maybe add controller code later if I have time, just wanted to get something up to help you out. Good luck!

Related

WinUI3 : Incrementally add contents to ListView On scroll

I am working on WinUI 3 desktop application in C++. I was trying to achieve an experience where when we scroll ListView, we will incrementally add rows to the end of the listviews dropdown during runtime.
For example, I might have 100,000 results to fit in a list view, I only want to show a limited number of contents in the list view, then as the user scrolls I'll add more contents to the list view.
I was not able to get any scroll-based events in ListView directly, so I extracted the ScrollViewer from the list view and handled the ViewChanged event. This event was fired when the scroll happened. But I was not able to get how many rows were scrolled or currently which row is been scrolled.
I want to get how many rows are scrolled so that I can insert enough rows to the end of the ListViews Item Source. It would be of great help if you could help me with this.
Thank You

Dynamics Nav - How to highlight a row in a FactBox that contains a list

Relatively new to C/AL development. We have a FactBox page that contains a repeater with a Temporary table page source. The number of lines in the FactBox matches the number of lines in the parent page. The temporary records in the FactBox are accumulated one at a time based on a call from the parent page OnAfterGetRecord trigger. They are loaded into the FactBox based on a call from the parent page OnAfterGetCurrRecord trigger.
1a. For purposes of discussion, lets say there are 10 records in the parent page and in the FactBox page. How do I highlight the matching row in the FactBox when the user selects a given row in the parent page (e.g. they select row 3, I want to highlight row 3 in the FactBox)?
1b. How do I highlight multiple rows if the user selects multiple rows with Shift+Click or Ctrl+Click?
In the case of 1a above, OnAfterGetRecord is fired in the parent page with a filter equal to the key. In the second case, OnAfterGetRecord is fired in the parent page for each record selected by the user with a filter equal to 'Marked: Yes'. If I try to use Mark in the FactBox page, it filters the records so that only the selected ones are displayed in the FactBox, which is not what I want.
We are using 2013R2, although I would be interested in answers for other versions as well.
Thanks in advance for any ideas and/or suggestions.
PS. The FactBox is kind of a summary at a glance idea for each list row contained in the parent page. It contains a handful of temporary table fields that are populated from the parent page row primary key when the parent page OnAfterGetRecord and OnAfterGetCurrRecord triggers are fired. There is a 1 to 1 relationship between parent page lines and FactBox lines.
Basically, instead of having the FactBox oriented vertically displaying data only for the active parent page row, we transposed the FactBox vertical fields into a horizontal row of fields and display one row of FactBox data for each row of parent page data. The FactBox resyncs when the user sorts the parent page by clicking on the headers, etc.
Now I can’t even imagine your business case. Maybe if you spill it you will get a better advice.
Short answer for what you’re asking is.. you can’t. And you don’t want to. This is a factbox. It should provide extended information about line which you don’t want to put into repeater or fasttab because it is from related table. Hence the limitations.
And one more thing. Nav is very limited in terms of different fancy events and triggers. The only way to make it more advance is to write your own visual plugin which will replace most of the page’s interface. There you can do whatever JS (for example) allows you to do.

How to set a value to an application item in oracle apex 5

I have several tabs. There is a date picker on each tab. I need that date to be the same on all tabs no matter what. So, if the user changes the date on Tab 1, then goes to tab 2, the date on tab 2 will have changed also. I have never created an application level item before and I thought that might be the most efficient way to accomplish what I need (by setting that item's value to the date the user selected). My problem is that I don't know how to set the value of the application item and also how to retrieve that value on another tab.
You didn't describe what exactly you're trying to do, but - if each tab represents its own table, why do you keep the same date value in all of them? Doesn't look like a normalized data model. Consider using a single date column (in one - master - table) and use (i.e. reference) it in others (i.e. details).
As of your question: How about creating a global page (i.e. page 0) and having a date picker item on it? You can display it on any other page you want. For example, if you set its value while on tab 1 and then move on to tab 3, you can again modify that value which will be visible on all other pages. Basically, you'd maintain just one item instead of as many as number of tabs involved. (BTW, doesn't that remind you of what I described in the first paragraph?).
Alternatively, create a date picker item on tab 1 page; on all other pages, create a "lookup" (display) item which would simply display what's been selected on tab 1. That's easy to do, just make its source to be an "Item", such as P1_DATE_ITEM.
In Shared Components > Application Items create new Item called G_DATE.
Then for every datepicker add Dynamic Action on Event Change.
In True action Set Value select Type PL/SQL Expression with code
:G_DATE := :P1_DATEPICKER1;
and Items to Submit :P1_DATEPICKER1
Next in every datepicker Source set Type PL/SQL Expression with code
:G_DATE
used Always (...)
Regards

In django-tables2, make number of rows displayed depend on screen size?

When using django-tables2, use the paginate parameter to limit the number of rows displayed. For instance, if I have the table my_table, then in views.py I set it to display 10 rows as follows:
RequestConfig(request, paginate={'per_page':10}).configure(my_table)
My problem is that in my app I want the number of rows shown per page to depend on how big the user's screen is. For instance, 10 rows for mobile devices, but 25 rows for desktop screens. I am imagining doing in views.py what you can do with style sheets using the media rule (e.g., #media(max-height: 480px) {do something}).
Unfortunately, my (noob) understanding is that in Django, the view is relatively insulated from low-level parameters like screen size. However, I don't want to implement some scheme like sending information from the template to the view if there is already a simple solution baked into django-tables2 that I am just ignorant of.
Note I am using Bootstrap4 for my front end, if that makes any difference. The point is that I am already importing Javascript and jQuery into the project, at least at the template level.
Related general discussion
Interestingly, I haven't seen a lot of discussion of adapting table row count to media type, but there is obviously tons of more general discussion of responsive media-sensitive design:
Responsive design with media query : screen size?
https://developer.mozilla.org/en-US/docs/Web/CSS/#media
I have no straightforward or complete solution, but I'll share some thoughts:
When (initially) rendering the table, Django-tables2 has no way of knowing the screen size. One of these workarounds might satisfy your needs:
Render less rows
In your initial page view, if your screen size is small:
Hide some rows, then, adjust the offset and number of pages you request for the next pages using JavaScript. This will involve rewriting url parameters of the pagination links.
Reload the page with a smaller number for per_page added to the url.
Default to rendering a smaller number of rows, and allow the user to change the number of rows rendered with a dropdown, which is hidden for mobile users.
Optimize template for responsiveness
Optimize the template for different screen sizes rather than changing the number of rows. An example of how this could work can be found in the table displayed in webpack documentation. You might still want less rows for smaller screens with this technique though.
Client-side table-sorting
If the total number of rows is reasonable, sending everything to the client and deferring the pagination to something like datatables might work.

Oracle APEX: Add list boxes on demand

I am new to APEX and was wondering if you could point me in the right direction. I have an app that has 24 pairs of list boxes, (24 is the limit per requirements). What I did was create and show all 24 and it looks weird. (See image here).
My question is this: Is there a way to have maybe just one pair show and as they make their selection, a new pair of list boxes appears? Or maybe have a button that says something like "add a new category / type" and once clicked, a pair of list boxes is created? This would go on until they've populated the 23 sets of list boxes since 24 would be the limit.
By the way, the selected category value drives the type value. On the linked image, the size of the list boxes varies because of this. Can those list boxes be made with a fixed width?
Oh, I'm using 4.2.
Having read through the posts on this, if you did want to attempt creating a report which has cascading select lists you could try the approach found at this link:
https://apex.oracle.com/pls/apex/f?p=39514:1:
It's a slightly long winded process so it may not be the easiest solution, however having read through the instructions the guy provides it seems do-able:
https://apextipps.wordpress.com/2010/11/02/cascading-lov-in-tabular-form/
Hope that is of some help.