Announcement

Collapse
No announcement yet.

Pagination instead of "show more"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pagination instead of "show more"

    Hi,

    (I'm not sure if this is the same feature request: http://forum.espocrm.com/feature-req...g-entry-x-of-y)

    But If I have lots of opportunities for an account. At the moment i need to click "Show more". The same for the Stream.

    When we have lots of data this is not so nice to use, as the page grows so big.

    Is is possible to have a pagination functionality?

    Thanks
    Andrew

  • #2
    Hi

    There should be code that can enable pagination but hasn't been being tested for 2 years. You can try to search by "pagination" keyword in file contents and try to enable it.
    Last edited by yuri; 09-07-2015, 01:37 PM.

    Comment


    • #3
      Thanks Yuri, I'll take a look. We'll be so happy if this works!

      Comment


      • #4
        in client/scr/views/record/list.js

        change false to needed option, to do this search this:

        /**
        * @param {string} or {bool} ['both', 'top', 'bottom', false, true] Where to display paginations.
        */
        pagination: 'both',


        this option still work in espo 4.2.4

        Comment


        • #5
          it works in 425 as well, you need a fiddle a bit with the design. We also added a possibility to change the number of shown records on the fly.
          ------------------
          Robert Laussegger
          iscon group
          http://www.iscongroup.net
          mailto://info@iscongroup.net

          Comment


          • #6
            iscon can you share the changes you've made?

            Comment


            • #7
              Hi yuri,

              I tried to use pagination and got the error of undefined variable "func". I checked in previous commit and found the that was changed about 7 months ago, and seems like there is a bug left in following commit.
              https://github.com/espocrm/espocrm/c...4b77c09bdbc53f.

              Did anyone fix this pagination thing? tanya

              Thanks!

              Comment


              • devscrew
                devscrew commented
                Editing a comment
                I have fixed this issue, there are two bug in latest commit of espocrm regarding pagination.

                Callback function is not defined error:
                file: client\src\views\record\list.js

                if (this.pagination) {
                this.createView('pagination', 'views/record/list-pagination', {
                collection: this.collection,
                }, func);
                }

                func is not defined in latest commit as that function has modified and got renamed as "callbackWrapped()", so replace func with callbackWrapped() will fix the pagination on list view.

                update code:

                if (this.pagination) {
                this.createView('pagination', 'views/record/list-pagination', {
                collection: this.collection,
                }, callbackWrapped());
                }


                2nd Issue:
                last option in pagination doesn't show records when total % maxSize return 0,
                File: client\src\collection.js

                e.g in list view there are 20 records and you set max row size as 10 to display in listview, so offset for last page will be 20,

                let offset = this.total - this.total % this.maxSize;

                Fix:
                Added patch to handle 0 remainder

                let offset = this.total - this.total % this.maxSize;

                //fix: to handle last page if remainder of last page is 0
                if(offset === this.total){
                offset = this.total - this.maxSize
                }

            • #8
              This has been implemented (though "experimental") in most recent version 7.0.9.
              Add in config.php:

              Code:
              'listPagination' => true
              My thanks to the developers.

              Comment


              • czcpf
                czcpf commented
                Editing a comment
                I'm using 7.4.5 and 'listPagination' => true doesn't seem to do anything.

              • shalmaxb
                shalmaxb commented
                Editing a comment
                I tested it right now and here it works.

            • #9
              Ok, I will try it again. Just so I’m clear, this enables list pagination for listViews and listViews (small) correct?

              Comment


              • shalmaxb
                shalmaxb commented
                Editing a comment
                Yes, in my installation that works for list and list (small)

            • #10
              Impeccable, works perfectly !

              Comment


              • #11
                'listPagination' was an experiment and is not supported. There're some issues with it. I do not recommend anybody enabling it. The amount of time we have spent to be able to deliver a quality product is negated by using such features, which is bit frustrating.

                Comment


                • rabii
                  rabii commented
                  Editing a comment
                  Hey we have been using it for more than a year and half and no issues at all. It offers a much better experience hence most of our users are familiar with pagination rather then loading more. should we keep using it or not ?
                  I think the only issue i have noticed so far is goin back to to previous records when used in an entity that has category tree like product. but no errors and no bugs

                • shalmaxb
                  shalmaxb commented
                  Editing a comment
                  In the beginning of this experimental phase I had issues sometimes (pagination not displaying under certain circumstances), but nothing, that damaged anything. I consider it handy in some situations, but I understand, if this is not supported, if it creates lots of headaches to the developers.
              Working...
              X