Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 13, 2012 04:11 AM by Yanping Wang - MSFT
Member
20 Points
13 Posts
Dec 08, 2012 11:10 AM|LINK
Hello..
I am using ajaxtoolkit autocomplete in a dictionary project and when I type it show the suggestion and it is (Direction:ltr) and I want to change it to (Direction:rtl) from a javascript function but I am not successed and this my code:
ajaxtoolkit:
<asp:AutoCompleteExtender ID="autocom" ClientIDMode="Static" runat="server" CompletionSetCount="10" CompletionListElementID="list" CompletionListItemCssClass="toolkitEnglish" EnableCaching="true" MinimumPrefixLength="1" TargetControlID="txtBoxWord" ServicePath="~/translator/AutoComplete.asmx" ServiceMethod="GetCompletionList" > </asp:AutoCompleteExtender>
and this is my JS code:
<script type="text/javascript"> var index = 0; function IndexChanged() { index = comboboxLang.GetSelectedIndex(); if (index == 0) { $("#txtBoxWord").css("direction", "ltr"); $("#txtBoxWord").val(""); $find('autocom').set_contextKey("1"); $find('list').set_CompletionListItemCssClass("toolkitEnglish"); //$("#list").removeClass("toolkitKurdish"); //$("#list").addClass("toolkitEnglish"); } if (index == 1) { $("#txtBoxWord").css("direction", "rtl"); $("#txtBoxWord").val(""); $find('autocom').set_contextKey("2"); $find('list').set_CompletionListItemCssClass("toolkitKurdish"); //$("#list").removeClass("toolkitEnglish"); //$("#list").addClass("toolkitKurdish"); } } </script>
Thank you
All-Star
65839 Points
11163 Posts
Dec 10, 2012 02:43 AM|LINK
I think that you can operation you can perform in GetCompletionList method in c#/VB.NET, it will be more easy
Star
14919 Points
1537 Posts
Microsoft
Dec 13, 2012 04:11 AM|LINK
Hello,
The code $("#txtBoxWord").css("direction", "ltr"); works for input to dispaly text from right to left.
The suggestion(competion list) are generated with ui li tags, please try to add CompletionListCssClass="list" and use the following style
ul.list{dir:rtl;}
thanks.
danarj
Member
20 Points
13 Posts
ajaxtoolkit autocomplete extender CompletionListItemCssClass change
Dec 08, 2012 11:10 AM|LINK
Hello..
I am using ajaxtoolkit autocomplete in a dictionary project and when I type it show the suggestion and it is (Direction:ltr) and I want to change it to (Direction:rtl) from a javascript function but I am not successed and this my code:
ajaxtoolkit:
<asp:AutoCompleteExtender ID="autocom" ClientIDMode="Static" runat="server" CompletionSetCount="10" CompletionListElementID="list" CompletionListItemCssClass="toolkitEnglish" EnableCaching="true" MinimumPrefixLength="1" TargetControlID="txtBoxWord" ServicePath="~/translator/AutoComplete.asmx" ServiceMethod="GetCompletionList" > </asp:AutoCompleteExtender>and this is my JS code:
<script type="text/javascript"> var index = 0; function IndexChanged() { index = comboboxLang.GetSelectedIndex(); if (index == 0) { $("#txtBoxWord").css("direction", "ltr"); $("#txtBoxWord").val(""); $find('autocom').set_contextKey("1"); $find('list').set_CompletionListItemCssClass("toolkitEnglish"); //$("#list").removeClass("toolkitKurdish"); //$("#list").addClass("toolkitEnglish"); } if (index == 1) { $("#txtBoxWord").css("direction", "rtl"); $("#txtBoxWord").val(""); $find('autocom').set_contextKey("2"); $find('list').set_CompletionListItemCssClass("toolkitKurdish"); //$("#list").removeClass("toolkitEnglish"); //$("#list").addClass("toolkitKurdish"); } } </script>Thank you
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: ajaxtoolkit autocomplete extender CompletionListItemCssClass change
Dec 10, 2012 02:43 AM|LINK
I think that you can operation you can perform in GetCompletionList method in c#/VB.NET, it will be more easy
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Yanping Wang...
Star
14919 Points
1537 Posts
Microsoft
Re: ajaxtoolkit autocomplete extender CompletionListItemCssClass change
Dec 13, 2012 04:11 AM|LINK
Hello,
The code $("#txtBoxWord").css("direction", "ltr"); works for input to dispaly text from right to left.
The suggestion(competion list) are generated with ui li tags, please try to add CompletionListCssClass="list" and use the following style
ul.list{dir:rtl;}
thanks.
Feedback to us
Develop and promote your apps in Windows Store