Configuring Paging Grid Column widths

Hi All,

I'm wondering if there's been any progress on the issue of not being able to configure column widths for Paging Grids (using a!gridField) like you can using editable grids (a!gridLayout)-- I read some discussions from a while back that state this is a limitation and paging grid column width defaults to the longest content in a field, but I was hoping there may be a work-around or some other solution that doesn't involve making the displayed grid editable. 

I have a Read Only grid in my records using a!gridField and one column is a comment field, so it's quite long, thus it pulls the entire grid into this long, narrow, unfriendly interface. I'd love to find a better way to display this read only data where some of the left side columns have little content and the right column has long comments. 

Thanks for the feedback.

-Sarah

  Discussion posts and replies are publicly visible

  • +1
    Certified Lead Developer
    Hi I agree, this is one of a limitation with paging grid, but there is a workaround to achieve your requirement, but I wouldn't say, it's the best way, but yes we can achieve your requirement in following way.

    Create an editable grid with read-only field, and configure the column width accordingly as per your requirement.

    Also do remember, in this approach, paging feature will not be available OOTB, so to achieve that, you need to create a section which takes pagingInfo as input and based on queryEntity paging the next and previous option should be appeared or disappear.

    Also when you go for Editable grid, you won't be able to utilise the feature of column sorting which is OOTB for Paging Grid.

    But if you handle the paging properly for Editable grid, then yes you can use editable grid with read-only fields to achieve your requirement.


    Hope this will help you.
  • Hi Sarah,

    We can use editable grid also for this purpose but you can manage this in paging grid also.

    There are multiple approaches for this -

    1.  Paging grid columns width set accordingly content so we can use char(13) in content of comment column for new line enter

        like : This is Comment char(13) This is new Comment

    2. We can also trim the content of column to a length 250 or more and put like: This is comment... and create this as dynamic link , if a user click on this link we can show a complete                    comment.

  • Thanks very much for your suggestions Alok! I'll be looking into this and also Ankit's suggestions below - all very good ideas.
  • Thanks for the suggestions Ankit - I really like option 1 using char(13) function -- I'll give it a try. I do want all the content to be immediately visible so option 2 would be a last resort. Thanks for your thoughts!