cancel
Showing results for 
Search instead for 
Did you mean: 

sap.ui.table headerSpan in xml views not working in 1.28.29 or even in higher version

alexander_gahr
Explorer
0 Kudos

Dear all,

i have a problem that i need to use a multi-header grid table.

When i use setHeaderSpan in javascript it works fine, however when i use headerSpan property of sap.ui.table in the xml view it seem not to work.

Is this a know bug or am i dong something wrong?

Does anyone have an idea how i can extent sap.ui.table.column so i can overcome this issue and set it still in the XML?

I tried also higher version and its not working in XML.

JSBIN with full minimal example code can be found here:

JS Bin - Collaborative JavaScript Debugging

Does not work:


<table:Column id="col2"

         hAlign="Center"

         headerSpan="[2,1]"

         >

            <table:multiLabels>

                  <Label text="Stock" />

                  <Label text="B2" textAlign="Center" class="tableHeaderWrap"/>

            </table:multiLabels>

            <table:template>

                 <Label text="{ShipCity}" />

            </table:template>

         </table:Column>

         <table:Column id="col3"  hAlign="Center">

            <table:multiLabels>

                  <Label text="Stock" />

                  <Label text="B2" textAlign="Center" class="tableHeaderWrap"/>

            </table:multiLabels>

            <table:template>

                 <Label text="{ShipName}" />

            </table:template>

         </table:Column>

Does work:


onInit : function () {

                         // this will work but in xml doesn't

                        this.byId("col2").setHeaderSpan([2,1]);

                     

                        );

Would be nice if anybody could help.

Regards

Alex

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Alex,

You can bind headerSpan property to a JSON model


<tb:Column headerSpan="{path:'multiHeaderConfig>/multiheader3'}">


var oMultiHeaderConfig = {

                multiheader1:[3,1],

                multiheader2:[4,1],

                multiheader3:[6,1]

            };

this.getView().setModel(new sap.ui.model.json.JSONModel(oMultiHeaderConfig), 'multiHeaderConfig');

Regards,

Dorian

alexander_gahr
Explorer
0 Kudos

Hello all,

i debugged it now into the UI5 code. And seems the value in the XML is passed as string.

in 1.28.28 SAPUI5

in /sap/ui/table.js

function Table.prototype._updateColumnHeader

at line 2242ff i can see that the is an jQuery.isArray(vHeaderSpan) which will fail as vHeaderSpan is

" '[2,1]' "

So this statement will from XML always return false.

Can i get a fix? Is there a good way to extend the control?

Best regards

Alex