I am using bootstrap for better look and feel of UI, my issue is pagination in data-table. I am showing 10 (showing Active records only in the list ) records per page, for example 11 records are there in listing, data-tables shows pages count as Previous, 1, 2 and Next so its fine for now.
Suppose I changed the status of anyone record in that list to In Active, now the records in the listing are 10 only. So my issue is it shows the pagination as same as Previous one without any record (11th record) i.e. Previous, 1, 2 and Next.
If I click on number 2 it will navigate to 2nd page without any records and it shows "No records found", That was my big issue with Bootstrap data-tables.
Related
I have a table which summarize the time spent by users on a specific page of the app.
I want to get the total time spent on this page per day.
The table:
user_id date label_of_the_page
1 2019-03-03T00:21:56.384Z . page we want
1 2019-03-03T00:21:57.314Z page we want
1 2019-03-03T00:21:58.024Z . page we want
1 2019-03-03T00:21:59.384Z new page
The idea is to make the difference between the first time the label_of_the_page is the page I want, and the time for which the label change. But, we have to do it for each person who reach the page. It can be several time the same user_id, so grouping by user_id is not a good idea, I think...
So I guess the simplest way is like this:
Make a new column with three labels:
Case 1: User in the page we are interested in, and in the previous row he was not
Case 2: User in an other page and was in the page we are interested in, in the row before.
Case 3: User in the page and was also on the page the row before, or in other page and other page in the row before
Then we only keep the rows of case 1 and 2, and we just have to make the difference between [time(case 2) - time(case 1)] for each session.
But Im not sure how I can make all of it with SQL.
I am working on a SSRS report. It is a Tablix with 1 group by city. I would like to have 4-5 records per printer page in PDF. Currently, it is printing 1 record per printed page. This is because I have set a hard page break after each group. I can remove that hard page break but I'm unsure how to get 4-5 on each printed page. I'm not that good with SSRS expressions. Any help is appreciated.
I would handle this by creating another column in your dataset which groups 4 or 5 cities. say the first 5 as 1, then the next 5 as 2 etc.. and then add a parent group to your city group using this column.. then set your page break on that group..
I have a table with 2 date fields and other columns. I have to be able to show stats on some of these columns between 2 dates that can be selected from a dropdown list.
All of this must be done in Apex. The client must be able to select a Start Date and an End date and then the count of for instance the number of Referrals between 01/SEP/17 and 30/SEP/17 must be shown.
The SQL code I used in Oracle to achieve this is:
select
'Total Referrals' as Details,
count(REFERRED) as Total
from PD_PATIENT_DETAILS where REFERRED = 'Yes'
and EVENT_DATE BETWEEN to_date(:EVENT_DATE) AND to_date(:EVENT_DATE_END);
I am now struggling to get this build in Apex. I only started working with Apex when I was brought onto this project. Have never worked with this before and am currently the only one working on it.
You can create 2 seperate page items and make them datepicker fields (P1_EVENT_DATE and P1_EVENT_DATE_END)
Your SQL query could look like this:
select
Total Referrals as Details
, count(REFERRED) as Total
from
PD_PATIENT_DETAILS
where
REFERRED = 'Yes'
and EVENT_DATE between :P1_EVENT_DATE and :P1_EVENT_DATE_END
Then you need to make an dynamic action (on change of one of the items, or make a go button) which submits the page or refreshes the report region (then you have to set the page items into the session state).
Something like this
I'm trying to get variable number of records per page in Yii. The page size is dependent on the number of records that match a criteria, so It has to be changed on every AJAX request sent by Yii's pagination.
Here's a sketch of the exact problem:
Table Structure [pk, user_id, entry_date, entry_message]
The view has a CGridView with pagination enabled and pageSize set to 10. What I want to do is to show the entries from one date on one page. For example, page one should show the entries from today. Page two should show the entries from yesterday. So I presume that the limit and the offset should be variable, but I can't quiet understand how to change them.
I have build a page that displays a list of ratings in an desc order.
I want to display only 10 items at a time. how do I select only, say the 11-20 rows
from the ordered array.
Is it possible to handle this in the query itself, or do i have to fetch the whole table and screen the relevant items?
#pics = Rating.order('rating desc').limit(10)
In this specific case, use .offset(10) in your current query.
In general, search for "rails pagination" on google or here on SO.