Input Field is not auto Expanding while entering forumla

Posted by: vamshikrishna.ext on 2 November 2022, 11:28 pm EST

  • Posted 2 November 2022, 11:28 pm EST - Updated 2 November 2022, 11:35 pm EST

    HI,

    As per our requirement when we type ‘=[’ or ‘[’ in the cell with the table , adrop down with all the column in table will be appeared . user can select any of the column. but Selecting a value from dropdown , input field in the cell is not auto Expanding., due to which entire value is not being displayed properly.

    please refer sample code and attachments.

    https://jscodemine.grapecity.com/sample/iGo-bOYfWEa5FDc3abbCGg/

  • Posted 6 November 2022, 1:25 pm EST - Updated 6 November 2022, 1:30 pm EST

    Hello Vamshi,

    From the list of column names, you might choose the one with the largest name and adjust the editor’s width accordingly.

    Please refer to the sample below, which determines the width according to the longest possible column name.

    Sample: https://jscodemine.grapecity.com/share/X6HZKZqjZkqlnVRUXO15SA/

    Regards,

    Ankit

  • Posted 6 November 2022, 10:10 pm EST - Updated 6 November 2022, 10:16 pm EST

    Hi Ankit,

    Thanks for the reply. when we try to select for second time, the input field is not expanding unless entering right arrow key. please find attachment for your reference.

  • Posted 8 November 2022, 11:22 pm EST

    Hello Vamshi,

    Please refer to the following modified sample. In the sample, I have adjusted the cellEditor’s width (line no. 169-171 in app.js):

        let width = getTextWidth(longestColumnName, font);
          
          cellRect.width = cellRect.width + width;

    Sample: https://jscodemine.grapecity.com/share/JTMYL6h1hk28LCwf9msz3A/

    Regards,

    Ankit

  • Posted 8 November 2022, 11:43 pm EST - Updated 9 November 2022, 12:07 am EST

    Hi Ankit . Thanks for reply. Instead of depending on longest column name as parameter for adjusting cellRect width, can we adjust in click listener event based on the text selecting from drop down.

  • Posted 10 November 2022, 7:43 pm EST

    Hello Vamshi,

    Currently, the sample does include the click listener for the dropdown. You could modify the sample as per your requirement to adjust the width of the editor element.

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels