Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Resize listgridfield according to title fails

$
0
0
Hi,
I have found some behaviour which shouldn't be so like state in the documentation.


Here you can see what happens using autoFitField. This method is also used if you doubeclick on the separator between the row-header.

In the documentation this the fit is happening the content or the title of the listgridfield. You can see in the gif, that the only thing which is considered is the content of the field.
Code:

int autoFitField (fieldName)

Programmatically cause a field to auto-fit horizontally to it's contents or title.
Does not establish permanent auto-fitting - use ListGrid.setAutoFitWidth() to do so.

Parameters:
    fieldName  - type: String

Is there a additional attribute, which has to be set for considering not only content of the row, but also the title of the row?

Here is the code for reproduction:
Code:

isc.ListGrid.create({
        "ID" : "theListGrid",
        "width" : "400",
        "alternateRecordStyles" : true,
        "modalEditing" : true,
        "fields" :
        [
                {
                        "name" : "long",
                        "title" : "Longer title",
                        "type" : "text",
                        "canEdit" : false
                }, {
                        "name" : "short",
                        "title" : "Shorter title",
                        "type" : "text",
                        "canEdit" : false
                }
        ],

        "data" :
        [{
                        "long" : "abc",
                        "short" : "This is a long text to show the resize behaviour",
                }, {
                        "long" : "abc",
                        "short" : "shorten",
                }
        ]
});
isc.Button.create({
        "action" : function () {
                theListGrid.autoFitField("long");
        },
        "title" : 'autofit first',
        top : 100,
        left : 0
});
isc.Button.create({
        "action" : function () {
                theListGrid.autoFitField("short");
        },
        "title" : 'autofit second',
        top : 100,
        left : 100
});

Best regards

Viewing all articles
Browse latest Browse all 4756

Trending Articles