jQWidgets Forums
jQuery UI Widgets › Forums › Grid › jqxGrid columns auto width
Tagged: datagrid
This topic contains 8 replies, has 2 voices, and was last updated by Peter Stoev 12 years, 10 months ago.
-
Author
-
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
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 StoevjQWidgets Team
http://www.jqwidgets.comHi 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,
khurramHi 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 StoevjQWidgets Team
http://www.jqwidgets.comHi 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,
khurramHi Peter,
I will send you a sample in a while.
regards,
khurramHi 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,
khurramHi Peter,
I think i find the way out , :), thanks.regards,
khurramHi khurram,
Thanks for sending the sample. Should we look into it or the issue is resolved?
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.