jQWidgets Forums

jQuery UI Widgets Forums Grid jqxGrid columns auto width

Tagged: 

This topic contains 8 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 10 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • jqxGrid columns auto width #8095

    khurram
    Member

    Hi,

    I am using jqwidgets version 2.2.1, i want to set the grid width to 100% and its column’s width to auto and i am doing it like this:

    $(‘jqxgrid’).jqxGrid({width:’100%’ /*, other properties */});

    var width = 20 * $(“#jqxgrid”).width() / 100;

    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, ‘Code’, ‘width’, width);
    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, ‘Name’, ‘width’, width);
    $(“#jqxgrid”).jqxGrid(‘setcolumnproperty’, ‘Desc’, ‘width’, $(“#jqxgrid”).width() – (2 * width));

    $(“#jqxgrid”).jqxGrid({ source: dataadapter });

    It works perfect initially(if grid has some more than 1 records). Basically i am doing server-side paging and sorting. If i update the record after filtering(custom filtering) then if grid has no records then its height becomes height of the 5 rows(as pagesize is 5).

    Any help would be appreciated.

    regards,

    khurram

    jqxGrid columns auto width #8105

    Peter Stoev
    Keymaster

    Hi khurram,

    When the width of a Grid column is not set, its default value is auto. It is not necessary to set the column’s width property. if you want the width to be automatically calculated.

    In addition, the current version of jQWidgets is 2.4.2 and I suggest you to upgrade to it as we have many enhancements and bug fixes in jqxGrid since the version that you use. For more information about these changes, please visit: releasehistory.htm.

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jqxGrid columns auto width #8113

    khurram
    Member

    Hi Peter,

    thanks for your quick response. Well actually i downloaded the current version i.e 2.4.2 , that issue is resolved i think, need to reconfirm but now the problem is jqxgrid.js has error , it says that “f is null”.

    regards,
    khurram

    jqxGrid columns auto width #8116

    Peter Stoev
    Keymaster

    Hi khurram,

    I’m afraid that I’m not sure what may be the cause for the behavior you have described. Therefore, providing a small sample in which this can be observed locally will be appreciated. Please, send the sample to support@jqwidgets.com or post a link to it.

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jqxGrid columns auto width #8117

    khurram
    Member

    Hi Peter,

    I tried to debug it, there is a method in jqxgrid.js i.e _updatecellwidths , fourth time it is being called, and now this.virtualsizeinfo is null which is being assigned to f, so it throws exception.

    regards,
    khurram

    jqxGrid columns auto width #8119

    khurram
    Member

    Hi Peter,

    I will send you a sample in a while.

    regards,
    khurram

    jqxGrid columns auto width #8159

    khurram
    Member

    Hi Peter,
    I have sent a sample to support@jqwidgets.com with name “jqxwidgetsSample”, just run it and you will find jqxGrid at home page.
    Waiting for your quick response as you always do. 🙂

    regards,
    khurram

    jqxGrid columns auto width #8165

    khurram
    Member

    Hi Peter,
    I think i find the way out , :), thanks.

    regards,
    khurram

    jqxGrid columns auto width #8166

    Peter Stoev
    Keymaster

    Hi khurram,

    Thanks for sending the sample. Should we look into it or the issue is resolved?

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.