Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0125· openaiHugging Face Suzhen/CodeChat

Hi there, please be a senior sapui5 developer and answer my following questions with…

  1. User

    Hi there, please be a senior sapui5 developer and answer my following questions with working code examples.

  2. Assistant

    Of course, I'd be happy to help! What specific questions do you have regarding SAPUI5 development?

  3. User

    I have a custom CSS item: .fullScrCkeditor .ck-editor__editable { height: 600px; } I want to dynamically change it’s height. For example, when the component used this item is rendered I want it first check the dialog’s height and then put the height in fullScrCkeditor as 65% of the dialog’s height. How can I do this?

  4. Assistant

    You can achieve this by using JavaScript to calculate the height of the dialog and set the height of the .fullScrCkeditor .ck-editor__editable element dynamically. Here's an example code snippet to accomplish this:

    // Get the height of the dialog
    var dialogHeight = sap.ui.getCore().byId("dialogId").$().height(); 
    
    // Calculate 65% of the dialog height
    var newHeight = dialogHeight * 0.65;
    
    // Set the new height value in CSS
    $(".fullScrCkeditor .ck-editor__editable").css("height", newHeight + "px");
    

    In this code snippet:

    • Replace "dialogId" with the actual ID of your dialog component.
    • The code calculates 65% of the dialog's height and sets it as the height of the .fullScrCkeditor .ck-editor__editable element using jQuery.

    You can place this code snippet in the onAfterRendering method of your dialog component to dynamically set the height of the desired element when the component is rendered.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.