EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  How can I break long text/word in a fixed width span of header?

    Posted Tue March 10, 2015 07:12 AM

    Hello,

    I m trying to break long text in a fixed width of headers in datagrid but i dont know how.

    That's my code below.

    Thanks!

     

    michaeldefox


  • 2.  Re: How can I break long text/word in a fixed width span of header?

    Posted Tue March 10, 2015 09:12 AM

    Hi,

    try it with :

    \n

    in your text.

    Marcel-D


  • 3.  Re: How can I break long text/word in a fixed width span of header?

    Posted Tue March 10, 2015 10:04 AM

    I have tried that but the headers doesn't seem to change width to accept new line.

    michaeldefox


  • 4.  Re: How can I break long text/word in a fixed width span of header?

    Posted Wed April 01, 2015 05:37 PM

    I have tried this but the text after the break is disappeared.

    new DataGridColumn{name = "field1", displayName = "Column 1<br/>Header", width=70,alignment = 1, headerAlignment = 1},

     

    Could you give any solution?

    michaeldefox


  • 5.  Re: How can I break long text/word in a fixed width span of header?

    Posted Tue March 10, 2015 11:04 AM

    One way to do this is change the cell.innerHTML inside the headbehaviors to it's desirable length by splitting the displayname with '<br>'.

     

     

    gweis


  • 6.  Re: How can I break long text/word in a fixed width span of header?

    Posted Thu April 02, 2015 05:11 AM

    Could you give a real example that includes cell.innerHTML

     

    Thanks.

    michaeldefox


  • 7.  Re: How can I break long text/word in a fixed width span of header?

    Posted Thu April 02, 2015 06:50 AM

    Something like:

        private function headerbehaviors (grid DataGrid in, cell Widget in, rowData any in, dataIndex int in, column DataGridColumn in)                case                        when (column.name == "field1")                                cell.innerHTML = "Column 1<br>header";                        when (column.name == "field2")                                cell.innerHTML = "Column 2<br>header";                end        end

     

    gweis


  • 8.  Re: How can I break long text/word in a fixed width span of header?

    Posted Thu April 02, 2015 07:20 AM

    I have many columns and when the example is like this one:

     private function headerbehaviors (grid DataGrid in, cell Widget in, rowData any in, dataIndex int in, column DataGridColumn in)
                    case
                            when (column.name == "field1")
                                    cell.innerHTML = "Column 1";
                            when (column.name == "field2")
                                    cell.innerHTML = "Column 2<br>header";
                    end
            end

     

    then the width of  background color of header cell with (column.name == "field1)  becomes smaller in half exactly  when  the header field2 looks ok. Why is that? Maybe it has to do with the width of header cells and their width?

     

    I changed to that:

    cell.innerHTML = "\n<br>Column 1";

    cell.innerHTML = "Column 2<br>header";

    and it worked for all headers except of the column with the checkboxes.

    The empty header cell above the checkboxes  seems like the attached photo.

    michaeldefox

    Attachments



  • 9.  Re: How can I break long text/word in a fixed width span of header?

    Posted Thu April 02, 2015 08:18 AM

    I had a similar need and it took me three steps.  See if this works for you.

    I took an approach similar to your first where I defined the column with the <br> in the displayName like so:

    new DataGridColumn{name="O5DTDUETI", displayName="Statement<br>Due to<br>Investor", width=DATE_WIDTH},

    Notice I also set the width...

    Then I defined a header behavior that set the cell height, otherwise the header cells would have different heights depending on how many rows in the title.

    function SetHeaderHeight (grid DataGrid in, cell Widget in, rowData ANY in, rowNumber INT in, column DataGridColumn in)

       cell.height = 50;

    end

    Finally I copied the EglRuiDataGridHeaderLabel css class into my local css file and changed the overflow: hidden; to overflow: visible;

    .EglRuiDataGridHeaderLabel {

       overflow: visible;

    }

    Kendall.Coolidge


  • 10.  Re: How can I break long text/word in a fixed width span of header?

    Posted Thu April 02, 2015 08:32 AM

    I just changed this line in Datagrid.egl file

    from:     cellPadding int{ @EglProperty, @VEProperty{ default = "4" }} = 4;

    to:          cellPadding int{ @EglProperty, @VEProperty{ default = "6" }} = 6;

    and it now looks ok although the checkboxes in their cells don't seem very symmetric.

     

    I 'll try your solution too.Thanks a lot.

    michaeldefox