What is the standard approach for paged collections in Backbone.js ? And how about sorting ? Does it support these features out of the box ? Do I need some sort of plugin ?
None of these things are supported out of the box (Backbone is a thin library, not a big framework).
For pagination check Backbone JS Pagination
For sorting, the think you have in Backbone is defining a comparator on a collection: http://documentcloud.github.com/backbone/docs/backbone.html#section-53
So one approach would be to initialize your collection, and then when you have to change the order, change it's comparator and call collection.sort. This would trigger a reset event that you can listen for in your view and re-render.
Related
When using DataTables, how can I control page size on the server-side? I want to take advantage of bult-in navigation buttons (prev, next etc.), but don't want clients to be able to dictate page size.
The only option I see is pageLength which controls page size from client's end, which defeats the purpose in my case.
This is Laravel application and I'm using Yajra package (DataTables as a Service) implementation. Note that I can't use Eloquent's built-in pagination because then I'll have to manage navigation myself and will also need to disable DataTable's own navigation because that one depends on pageLength.
A good way is to remove the present page size in the datatable by adding paging to false on data table options.
Then u can do pagination by simply add laravel pagination class when dragging data from your models. E.g
$all_items = user model::paginate($page_size,['*'],'page_no');
The last variable of the paginate method is just indicating the parameter name of the page no. Useful when you have more than pagination in a page. It can be changed to whatever unique value u like.
Does Handsontable support server side pagination like jqgrid? handsontable
If you are looking for a pagination where you define some methods in the table definition and that magically handles the pagination I think the answer is NO, HT focus more on the presentation of the data to be more like Excel sheets leaving the pagination to each implementation. At the beginning I was not very happy about that, but you can handle the pagination by yourself using any strategy you decide and later updating the content of your table using "loadData".
Now, if you are looking for a scroll pagination approach, that is something I have not explored enough, HT has a very smart scroll strategy where only creates the elements that needs making the render very fast when working with large sets of data, so, I am not sure that type of scroll you are expecting it is possible as HT needs to know the total data size to correctly draw the vertical scrolls, maybe if you create empty rows for all data your expecting giving a static height each and later when you detect new data is needed while scrolling you fetch from the server side the missing data you can achieve the same result, here seems that feature was discussed Infinite scroll
After some research, found it doesn't support server side pagination.
I have a JSF page with PrimeFaces 5.1 and I'm experiencing performance issues in a complex page. The page has a common design: a paginated datatable, a tree for filtering, a panel with the selected item details and a menu with some actions on that item. The majority of these components are provided by PrimeFaces.
Profiling the application, I concluded that the DB queries are not the bottleneck but rather the restore view and render response phases. Moreover, the major factor in the delay seems to be the number of JSF components as opposed to the amount of data stored in the backing bean. Even AJAX requests with partial processing and rendering will take time in those phases.
How can I reduce the processing time, specially in the AJAX requests?
My 'short list':
Use a recent version of your JSF library (especialy Mojarra > 2.1.21)
Use partial processing (process="#this") (already mentioned by you)
Don't use validation on ajax requests (immediate=true)
Use partial submission (partial-submit="true")
Be selective in what you update (Not an #form)
Don't do any amount of work in a getter (and if you do, do it lazy)
Don't use inline editing in the datatable
Use native components in the datatable if you do cannot do 7
Don't use loooooooooong select lists
Use lazy loading for filtering, sorting and paging in datatables and use a page size value that is moderate (tnx #Vrushank, I forgot this)
Don't use partial state saving in Mojarra with complex pages
Don't know whether it is possible but is there way in which I could provide multi-column sorting in a repeat control which displays field values from a document collection?
The easiest way to get the multi-column sorting is to use a Data Grid.
Out of the Extension Library box you can use the Dojo Data Grid control. Brad Balassaitis wrote a good description how to use it in his blog Xcellerant. There you can find a link to an example database too. A good starting point is the XPages "REST_DojoGrid" in database XPagesExt.nsf which is included in Extlib download also.
As an alternative you could use data grids based on jQuery like jqGrid.
You could do a lot of complicated stuff, like putting docs into a java TreeMap object in order to sort them on the fly.
Or you simply use jQuery and the tablesorter plugin: http://tablesorter.com/docs/
Hy guys.
As you know the gridview control is super heavy and reduces performance of the page, as the viewstate length is higher.
I'm trying to get a alternative way to not use default asp.net gridview webforms.
In asp.net mvc we can pass a model for example with Examples[] and in the view iterate over this array and build a
grid and using a number of pages as a anchors than when clicked do a request to a one controller and retrieves json with content of the next 10 tuples in database.
My question is, what is for you guys the best way/more efficient to implement a gridview with paging in webforms?
We use classic AJAX calls and javascript to render and filling the gridVeiew. We are also using the jQuery gridviews now. I am aiming at the reduction of data transfered if we are using a asp:gridview inside a ajax:updatePanel.
Unless you plan to use the fill GridView functionality, I usually prefer rendering the UI out as HTML TABLE using a asp:Repeater control.
HTH.