Unable to resize a HTML field in service catalog?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2019 04:05 AM
Hi All,
I am trying to resize a HTML Field in service catalog when the values are getting added in a table so that I do not need to scroll the values.
var html1 = g_form.getControl('comments');
html1.style.height = (textarea.scrollHeight) + "px";
OR
g_form.getControl('src_cg_bu_data_table_approval').style.height = '200px';
OR
g_form.getControl('src_cg_bu_data_table_approval').setAttribute('style.height', '200px');
I tried all the above from the communities but everything throws a client script error as shown below.
js_includes_sp.jsx?v=05-06-2019_1040&lp=Thu_Jul_04_12_03_20_PDT_2019&c=8_153:67593 (g_env) [SCRIPT:EXEC] Error while running Client Script "BUTableResize": TypeError: Cannot read property 'setAttribute' of null
Is there any UI Script which needs to be enabled to use the Style Attribute?
Please help.
Regards,
Sriram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2019 04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2019 04:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2019 04:23 AM
Try with this code:
var fieldName = 'comments'; //Change with variable name of HTML field
var changeHeight = g_form.getControl(fieldName);
changeHeight.style.height = changeHeight.scrollHeight + '200';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2019 04:29 AM
Hi Diane,
I get the same error as shown below.
(g_env) [SCRIPT:EXEC] Error while running Client Script "BUTableResize": TypeError: Cannot read property 'style' of null
(anonymous) @ js_includes_sp.jsx?v=05-06-2019_1040&lp=Thu_Jul_04_12_03_20_PDT_2019&c=8_153:67593
js_includes_sp.jsx?v=05-06-2019_1040&lp=Thu_Jul_04_12_03_20_PDT_2019&c=8_153:32589 snPresence response time 809ms
2js_includes_sp.jsx?v=05-06-2019_1040&lp=Thu_Jul_04_12_03_20_PDT_2019&c=8_153:67593 (g_env) [SCRIPT:EXEC] Error while running Client Script "BUTableResize": TypeError: Cannot read property 'style' of null
(anonymous) @ js_includes_sp.jsx?v=05-06-2019_1040&lp=Thu_Jul_04_12_03_20_PDT_2019&c=8_153:67593
js_includes_sp.jsx?v=05-06-2019_1040&lp=Thu_Jul_04_12_03_20_PDT_2019&c=8_153:32589 snPresence response time 675ms
Regards,
Sriram.