I want to count below element, but actually it counts only the elements that are in the display on screen. So if i have 100 elements I need to scroll down more. How can I include the others in the count too?
It depends on how is your application implemented.
Now, developers usually reuse the resource to display those stuff to avoid wasting resources.
For example, you have below table
[index][content]
1-A
2-B
3-C
4-D
5-E
When you scroll down, the first element will be disappeared, and developer use that resource to display right behind the last element (or they will use a-buffer-element to display - e.g: index=6)
[index][content] - after you scrolled down
2-B
3-C
4-D
5-E
6-F (first resource here - or it is the buffer resource)
With that implemented way, you can't use "xpath_count" to count.
Let's try to scroll down (use for loop to count the number of elements in a page - then scroll down and continue counting them)
Related
In my web application, there is a table which has more than 50,000 rows and is using a lot of HTML <div> tags. when opened in chrome or firefox table is rendered properly but Edge is only rendering a few rows of the first column and is going unresponsive.
Is this a limitation of the browser? or
Can it be fixed through browser specific coding?
please suggest anything related to this topic.
Edit1:
The web application is built using asp.net 3.0 web forms.
It is not working in IE11, Edge.
MSDN Forum link: Edge Limitation in rendering a table having more than 50,000 rows
Table rendering is quite demanding on a browser, because it basically needs to render the content of all cells first to be able to determine how wide each column has to be. It can not safe on performance here by rendering only what is currently visible inside the viewport.
And having a table with that large amount of rows only makes it "worse" - 50,000 rows is a lot. (Not only for the browser, but probably for the user as well. Maybe it might make sense to offer them to filter the data somehow up front, or implement a pagination?)
You can try table-layout:fixed to speed up the table rendering, for a bit more details see http://www.competa.com/blog/speeding-up-rendering-of-large-html-tables/ and https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout
The browser will then apply the widths of the cells of the first table row as the column widths for all that follows; so usually it makes most sense to use this property in combination with explicitly specified cell widths.
I'm implementing infinite scroll with will_paginate and ajax. Whenever I press the 'load more' elements, it brings me the next 4 elements in the collection. At the moment, everything is ok. But when I remove some element of some page, the next page has been already established in the 'load more' button; because of this, the next time I press the 'load more' button, one element is skipped. Does anybody know how can I solve this? (Sorry about my english)
Pagination gems don't work very well in your use case.
The easiest way to solve this is: if you have a list of elements ordered by e.g. id, on your next page request send the id of the last element on the current page, and use it to offset the next page.
What is happening is that pagination isn't eager loading the next set, but instead is doing an offset count
initial index + page_length * (page number - 1)
limit page_length
When you delete an element it forward shifts the index of every element after it in the database for this query. Which leaves your front end element indexes at a different state than the backend has.
You will need to re-load every "page" starting with the one containing the deleted element and work to the latest loaded "page" to get the front end to have the same element indexes that the back end has.
I have a report created with Digital Metaphors ReportBuilder (VCL edition, in Delphi XE3).
It's an invoice, with header, detail and footer bands.
When the data fits in one page, all is well.
If I have more data, that fills, lets say for the sake of argument, 2 pages, I would requires:
Footer band only in the last page
On all other pages, the footer band should be replaced with only the running amount from the detail band, up until that page (from the first one).
On all but the first, the header should include the running totals of all previous pages.
Something like:
Page 1:
- (Header)
- Detail
- "Value until now: (Sum of one the the fields present in the detail band)"
Page 2:
- (Header)
- "Value until now: (Sum of one the the fields present in the detail band) of previous pages"
- Detail
- Footer
I've tried to investigate group totals, using a DBCalc component, but those aren't aware of the page. It only shows the total in the end, and not at the end of the page.
Any pointers of how I could do this?
Thank you
You will need to make some use of the Calc tab, in order to decide when you want certain bands to be shown or hidden. The Report has a PageNo property which you can use to decide when to show a header or a footer, in the header or footer's BeforePrint event.
As for showing a running total at the bottom of each page, you could use a ppRegion component (which is the ReportBuilder equivalent of a Panel). Again, you can use the BeforePrint event to decide when this shows.
The running totals themselves should be done using ppVariables. As you traverse through the data, add values into each variable that you need. Put these variables in the Region mentioned above, and they will display the value as it is at the end of each page. Timing can play a part here, so you may need to adjust the Variable's CalcType, ResetType, CalcComponent and ResetComponent properties to fit your needs.
I have been using ReportBuilder for almost 10 years and believe me, everything can be done, but some operations may just take time to perfect. We now use it exclusively in our software, both for the standard reports that we issue with our product (over 300) and for users to create their own reports.
White boxes represent items in an NSArray.
Swiping from a directing changes the indexes and update the items accordingly. (not scrolling 1 by 1 but like changing pages. So, changing all 4 items at every swipe)
In this example, there are approximately 20 items in this array and we are in the second page. It currently shows item at index 4,5,6,7.
There can be more items.
I don't want to create at least 20 items and keep them at a far frame (CGRect).
I want to have a scheme like UITableView, where it creates approximately 6 items for infinite number of items if the tableview can show only 4 items at a time.
So, I plan to have 5 or 6 items for 6+ items and just update the item's contents (item = white boxes) according to real data at that index of NSArray
Is there a quick and ready way to do this easily or may there be a better way to do something like this?
instead of using tableview you can use scrollview with page control.
try using this link :https://github.com/cwalcott/UIScrollView-Paging/tree/buttons
If I have a a number of elements in one table column and I drag them one at a time to another column utilizing jQuery UI, how do I make remaining items in the first column move up, i.e. fill the gap left by the items that were moved. Assuming table cell valign="top".
I think it has to do something with DOM. It seems that even after I drag the item is it still in the same column.
You might want to use jquery ui's sortable instead.
http://jqueryui.com/demos/sortable/#connect-lists
You can connect lists and anything moved from one list will move the remaining elements to fill any gaps
However you are not giving us any code/markup to work with so I can only guess. Hope this helps!