jQuery UI Widgets › Forums › Grid › Margin/padding when values is large
Tagged: autorowheight, grid, jqxgrid, large data
This topic contains 6 replies, has 2 voices, and was last updated by nico86 10 years ago.
-
Author
-
I have modified the rowheight in the definition of the grid like that
$("#jqxgrid_1").jqxGrid( { width: "99%", height:"96.3%", rowsheight : 14, pageable: true, pagesizeoptions: ['5', '10', '20', '30'], pagesize: 10, source: dataAdapter,columnsresize: true,enabletooltips:true,sortable: true,altrows: true, theme: 'metro',
and also the css :
.jqx-grid-cell {
font-size:10px!important;
}I have created a cellsrenderer variable because vertical-align was wrong and add margin… But it seems something strange in line 3 with the margin…
(i have tried padding but it is similar)var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties) { return '<span style="vertical-align:middle;margin:3px">' + value + '</span>';}
As you can see on the screen this below, everything is OK (the margin of 3px is taken into account) if the text is smaller than the width of the column but if the width of the text is upper that the width of the column (line 3) then there is no sufisante margin and the text is stuck at the edge of the cell
How may I make ?
Thanks
Nicolas.Hello Nicolas,
If you want to show the large text in cell you can set ‘autorowheight’ property to true. When it is set to true, the height of the Grid rows is dynamically changed depending on the cell values.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Thanks for your responses but No I do not want to increase the height of my cells because I can have a great deal of text in a cell, I want just to be able to solve the problem of margin when the size of my text is bigger than the width of the column
Hi Nicolas,
You can set ‘width’ property to each grid column with value which you needed to show the entire text. If this suggestion does not help you, please, provide jsfiddle.net sample in order to see what’s going wrong with your code.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/HI,
Because i have a very important number of colum i can’t set the width with a large number.
But I have made a little example, and surpise all is ok : http://jsfiddle.net/ayTST/123/
the margin that i have put in the cellrender is take into account even if the column is more important that the width.But i don’t now in my application it doesn’t work…..may be a css conflict…. 🙁
Nicolas
Hi Nicolas,
Could you, please, check if there are duplicated css selector(classes and ids) names in your application ?
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/i have changed many things and i don’t why but it work fine now….thanks
-
AuthorPosts
You must be logged in to reply to this topic.