Skip to content

Commit 6089098

Browse files
author
minjk-bl
committed
Edit auto-generated label to bold-style on required
1 parent d0d7eb6 commit 6089098

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

visualpython/js/com/com_generatorV2.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,15 @@ define([
165165
var tblContent = $('<td></td>');
166166

167167

168-
let { name, label, component, required } = obj;
168+
let { name, label, component, required, output } = obj;
169169
let value = state[name];
170170

171-
var requiredFontStyle = required == true? 'vp-orange-text' : '';
171+
var requiredFontStyle = '';
172+
if (required === true) {
173+
requiredFontStyle = 'vp-bold vp-orange-text';
174+
} else if (output === true) {
175+
requiredFontStyle = 'vp-bold';
176+
}
172177
var lblTag = $(`<label class="vp-bold">${label}</label>`).attr({
173178
'for': name,
174179
'class': requiredFontStyle,
@@ -823,7 +828,7 @@ define([
823828
* @param {array/boolean} columnWithIndex boolean array or value to decide whether select tag has index option
824829
* Usage :
825830
* $(document).on('change', this.wrapSelector('#dataframe_tag_id'), function() {
826-
* pdGen.vp_bindColumnSource(that, 'dataframe_tag_id', ['column_input_id'], 'select', [true, true, true]);
831+
* pdGen.vp_bindColumnSource(that, 'dataframe_tag_id', ['column_input_id'], 'select', false, false);
827832
* });
828833
*/
829834
var vp_bindColumnSource = function(pageThis, targetId, columnInputIdList, tagType="input", columnWithEmpty=false, columnWithIndex=false) {
@@ -915,7 +920,7 @@ define([
915920
'class': 'vp-select vp-state'
916921
});
917922
// make tag
918-
list.forEach(listVar => {
923+
list.forEach((listVar, idx) => {
919924
var option = document.createElement('option');
920925
$(option).attr({
921926
'value':listVar.value,
@@ -932,6 +937,7 @@ define([
932937
$(pageThis.wrapSelector('#' + columnInputId)).replaceWith(function() {
933938
return $(tag);
934939
});
940+
$(pageThis.wrapSelector('#' + columnInputId)).trigger('change');
935941
}
936942
}).catch(function(err) {
937943
vpLog.display(VP_LOG_TYPE.ERROR, 'com_generator - bindColumnSource error ', err)

0 commit comments

Comments
 (0)