I. Overview
1.1 Problem
When the cell is large, the radio button group widget will not be centered horizontally or vertically.
1.2 Solution
We can use JS to obtain the object, and change its CSS style.
II. Example
Add a radio button group widget to the cell. Set customized data dictionary. Check [Adaptive].
Adjust the cell width and height, add a border to the cell.
Add an after initialization event to the widget. Enter the following JS:
var el = $(this.element);
var f = function() {
var w = 0;
var cs = el.children();
if (cs.length == 0) {
setTimeout(f, 100);
return;
}
for (var i=0; i<cs.length; i++) {
w += cs.eq(i).width() + 5;
}
el.css({
width: w,
'margin-left': 'auto',
'margin-right': 'auto',
'height':' auto',
});
}
setTimeout(f, 100);
Save and data entry preview: