Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
8920
web drop down text not showing string from the begoinning
posted

In wdd text after get selected shows rather end of the text string.  String is longer then the bos, how to make it display string from the beginning, i.e.

in the attached example the string 'Exhibit LR5: U.S. Foreign Tax Credit Data' shows  as: 'oreign Tax Credit Data'  and I would like to have it as 'Exhibit LR5: U.S. Foreig....'  means showing text from the beginning.

Parents
No Data
Reply
  • 29417
    Offline posted

    Hello,

     

     Thank you for posting in our forum.

    Generally the Drop down will set the cursor position at the end of the string. You could set the it to the beginning if you’d like. For example you could handle the web drop down’s focus client side event and set the caret position in the beginning. For example:

    <script type="text/javascript">      

    function setCaretPosition(elemId, caretPos) {

    var elem = document.getElementById(elemId);      

    if (elem != null) {             

    if (elem.createTextRange) {          

    var range = elem.createTextRange();

                        range.move(

    'character', caretPos);

                        range.select();

                    }

                   

    else {

                       

    if (elem.selectionStart) {

                            elem.focus();

                            elem.setSelectionRange(caretPos, caretPos);

                        }

                       

    else

                            elem.focus();

                    }

                }

            }

           

    function WebDropDown1_Focus(sender, eventArgs) {         

    var input = eventArgs.get_browserEvent().target;

                setCaretPosition(input.id, 0);

            }

    </script>

      

    Let me know if this is what you’re trying to achieve.

     

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

Children