Monday, November 5, 2012

How to re-size columns in CRM 4 + javascript

Hi
i didn't find any way to resiza a column on the internet but i can find a way with javascript  that resize a column.
you can use this function in your class in javascript code  and resize your column , that's it.


//this function set width for a field
//"object" argument is an object that is a field and "width" argument can be percentage or pixel and its type is String

    CommonClass.prototype.SetWidthField = function (object, width) {
        //we ensure that object style doesn't change so we save on "oldStyle"
        var oldStyle = object.style.cssText;

        //concat old style with new attribute (width)
        object.style.cssText = oldStyle + ';' + 'width:' + width + ' !important';
    }


sincerely
S.Amir S.Hosseini

No comments:

Post a Comment