0

In a ui grid in my application there are many columns . But when I try to display them all this what my grid columns look like :

enter image description here

The headers are not there but some how the values are there and it is being a big issue.

The Grid Options I have are ...

this.getGridOption = function (uiScrollOption, BestIndicatorParam, paginationPageSize, enableRowSelection, enableRowHeaderSelection,
    enableSelectAll, enableColumnResize, enableGridMenu, enableFiltering) {


    return {
        enableRowSelection: typeof enableRowSelection !== 'undefined' ? enableRowSelection : false,
        enableRowHeaderSelection: typeof enableRowHeaderSelection !== 'undefined' ? enableRowHeaderSelection : false,
        enableFiltering: typeof enableFiltering !== 'undefined' ? enableFiltering : false,
        enableSelectAll: typeof enableSelectAll !== 'undefined' ? enableSelectAll : false,
        enableColumnResize: typeof enableColumnResize !== 'undefined' ? enableColumnResize : true,
        rowHeight: 55,
        paginationPageSize: typeof paginationPageSize !== 'undefined' ? paginationPageSize : 5,
        paginationPageSizes: [5, 10],
        enablePaginationControls: false,
        enableVerticalScrollbar: 0,
        //enableHorizontalScrollbar: typeof uiScrollOption !== 'undefined' ? uiScrollOption : 0,
        enableHorizontalScrollbar:1,
        enableGridMenu: typeof enableGridMenu !== 'undefined' ? enableGridMenu : true,
        showGridFooter: false,
        columnDefs: this.columnDef,
        data: ''
    }
};

When I show 4-5 columns it is fine , but when I show them all this problem is annoying. What needs to be done. Please help.

Also I need to enable horizontal scroll bar . That's also not working.

I tried to give uiGridConstants.scrollbars.ALWAYS.

But did not work.

1

2 Answers 2

1

You have to give column width as shown below.

columnDefs: [
                    {
                        name: app.localize('IplNumber'),
                        field: 'id',
                        width: 100,
                    },
                    {
                        name: app.localize('BrDateReceived'),
                        field: 'bpoHeaderPerformedForsOutput[0].dateReceived',
                        width: 140,
                    },
 ],

To enable Horizontal Scroll bar where you have to give it as shown below.

enableHorizontalScrollbar: uiGridConstants.scrollbars.WHEN_NEEDED,
Sign up to request clarification or add additional context in comments.

Comments

0

Add width for each field in the columns definition with percentage. It will resolve the issue.

[ { name: app.localize('IplNumber'), field: 'id', width: 10% }, 
  { name: app.localize('BrDateReceived'), field:width: 15% }
]

Specify for all of your fields.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.