PDA

View Full Version : Padding in grid cells when using templates ( how to remove it ?) ...



valfumble
2 Dec 2010, 2:55 PM
Hi.

I am trying to reduce the padding around the template in a cell of grid, however cannot find setting to do so.

Any pointer will be greatly helpful.


Thanks,

Valsar..

Condor
3 Dec 2010, 4:52 AM
It's all css.

Poke it with Firebug and see which css rules are setting the <td> and inner <div> padding. Then add css rules that override this padding specifically for your grid cells.

valfumble
6 Dec 2010, 3:26 PM
I was able to solve the problem with this approach


var el = p.getEl();
var parent = el.parent();
var dom = parent.dom;
var childNodes = dom.childNodes;
dom.removeChild(childNodes[0]);

The childNodes[0] is the text node remaining due to '' being returned by renderer...



renderer: function(value, metaData, record, rowIndex, colIndex, store) {
.............//using panel as cell renderer



return '';

Please let me know if there is a better way to solve this. I could not get it to work by changing padding/ margin etc in all kinds of css attributes in div/td etc..

valfumble
6 Dec 2010, 3:27 PM
Thanks. I did manage to solve it...