How to show More record option(button) in the custom sidecar.

Hello,

I have a module Inventory Item where I am showing a custom sidecar on creating records. Sidecar shows on related To Order request Item option and in the sidecar, I am showing other modules (Order Request Item) record lists. Afterload 20 records, I want to add the load more records button(Link).

Please help to customize this.

Parents Reply Children
  • Hi André Lopes


    "Show More" is not rendering automatically in custom sidecar. Can you explain with example?

    My code:

    $viewdefs['II_Inventory_Item']['base']['layout']['wp-selection'] = array(
        'type'       => 'selection-list',
        'components' => array(
            array(
                'layout' => array(
                    'type'       => 'base',
                    'name'       => 'main-pane',
                    'css_class'  => 'main-pane span12',
                    'components' => array( 
                        array(
                            'layout' => array(
                                'type'             => 'filterpanel',
                                'availableToggles' => array(),
                                'filter_options'   => array(
                                    'stickiness' => false,
                                ),
                                'components'       => array( 
                                    array(
                                        'view'       => 'customWp-selection',
                                        'context'    => array(
                                            'module' => 'M03_Work_Product',
                                        ),
                                        'loadModule' => 'II_Inventory_Item',
                                    ),
                                ),
                            ),
                        ),
                    ),
                ),
            ),
        ),
    );

    ({
        extendsFrom: 'MultiSelectionListView',
    
        allowedFields: ["name", "work_product_status_c"],
    
        initialize: function (options) {
            this._super("initialize", arguments);
            this.collection.reset();
        },
    
        render: function () {
            this._super("render", arguments);
            this.layout.$el.parent().addClass("span12 wp_selection");
            this.layout.$el.parent().css("width","100%");
        },
    
        addActions: function () {
            this._super('addActions');
            this.rightColumns = [];
    
            this.meta.panels[0].fields = _.filter(this.meta.panels[0].fields, function (field) {
                return this.allowedFields.indexOf(field.name) !== -1
            }.bind(this));
        }
    })

     

    var wpLayout = this.layout.layout.getComponent("dashboard-pane").getComponent("wp-selection");
                                var wpView = wpLayout.getComponent("main-pane").getComponent("filterpanel").getComponent("customWp-selection");
    
                                var wpModels = [];
    
                                if (wps.records && wps.records.length > 0) {
                                    wpModels = wps.records;
                                }
    
                                wpView.collection.reset();
                                wpView.collection.add(wpModels);
    
                                wpView.render();

    Thanks 

    Laxmichand saini 

    laxmichand