SearchKit - Default to simple pager when creating new table display
authorColeman Watts <coleman@civicrm.org>
Wed, 11 May 2022 15:00:23 +0000 (11:00 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 11 May 2022 15:00:23 +0000 (11:00 -0400)
Before: Pager default included "row count" and "adjustible page size".
After: Defaults to simple pager without the extras.

The extra stuff isn't always useful and can break the layout on small screens or dashlets,
so I think a better default is to exclude rather than include them.

ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.component.js

index b8cdfee5a5b37eb654810728a4cbd4082a7e93d5..11dfb6522fdf0d8eec4d1d4dc19c7e95580f39e8 100644 (file)
@@ -44,7 +44,7 @@
 
       this.$onInit = function () {
         if (!ctrl.display.settings) {
-          ctrl.display.settings = _.extend({}, _.cloneDeep(CRM.crmSearchAdmin.defaultDisplay.settings), {columns: null});
+          ctrl.display.settings = _.extend({}, _.cloneDeep(CRM.crmSearchAdmin.defaultDisplay.settings), {columns: null, pager: {}});
           if (searchMeta.getEntity(ctrl.apiEntity).order_by) {
             ctrl.display.settings.sort.push([searchMeta.getEntity(ctrl.apiEntity).order_by, 'ASC']);
           }