With the large number of 27000 words, i got the problem, that it tooks a lot time (aprox. 60 seconds) to display the website.
The autocomplete works with the 27000 entries. (Not fast, but it works!)
How can i reduce the time loading the website? Any trick?
(The words are from a MySQL-server)
-- modified at 3:32 Tuesday 20th November, 2007
I have solved the problem!
By changing the source from MySQL to a plain ASCII-File the time is very fast. (max. 3 seconds)
Your register starup script will look something like mine which pulls from a LINQ Query...
(yes I know lists are slow )
<br />
List<string> someList = (from s in DC.Table select s.FieldIwant).Distinct().OrderBy(s=>s).ToList();<br />
/*^^^--- Get your data into this List or Object any way you want, but fetch the data in the codebehind Page_Load*/<br />
<br />
//Setup stringbuilder<br />
System.Text.StringBuilder sbList = new System.Text.StringBuilder();<br />
/serialize someList<br />
jss.Serialize(someList, sbList);<br />
//create startup script string<br />string startupScript = "FillAutoComplete('" + sbList.ToString() + "');";<br />
//pass to clientscript manager<br />
cs.RegisterStartupScript(this.GetType(), "FillComboBoxes", startupScript, true);<br />
</string>
I am integrating the ACTB in my application. It works perfectly fine except for one thing. My we page has select boxes just below the text boxes. Now, when I enter some characters and the auto complete div list comes, it gets hidden on the places wherever the select box is. Can you please suggest me what should I do or is there any fix available for that? If not then when the fix for this will be available.
This is a problem in IE6 where select lists appear above all other elements. I have seen implementations where frames have been put behind the autocomplete to cover the select list but I have not seen any versions of this autocomplete which do this.
Any update on a fix for this at all as it is a major roadblock?
I am having the same problem in IE6 but hope to have it sorted with the following functions which normally do the job for other popups that I have. You just need to run the respective function from the show/hide triggers of your popups.
function hideDrops() {
var drops = document.getElementsByTagName('select');
for (i = 0; i < drops.length; i++) {
drops[i].style.display = 'none';
}
}
function showDrops() {
var drops = document.getElementsByTagName('select');
for (i = 0; i < drops.length; i++) {
drops[i].style.display = 'none';
}
}
You can of course be more specific as to which Tags/Divs etc you wish to show/hide by using document.getElementById('your_element_id')
Now where will those triggers be in the auto-complete code?
Edit:
This worked for me! Assuming you have also entered the above mentioned functions too.
After Line:163> actb_display = true;
type> hideDrops();
After Line:365> actb_display = false;
type> showDrops();
After Line:381> actb_display = 0;
type> showDrops();
Hi I used the actb control (v1.31) for a text area. Once text area has some (multiple line) text, up and down arrow keys cant be used to move up down in text area. Only left and right arrow keys work.
For a text area user do need to be able to browse using all arrow keys to edit existing content.
I’m investigating your code and it seems really good!!.
I wander if you can help me to do this task,
I have to auto complete e-mail, so what I want is after the user type “@ “ show a list of possible e-mail list.
Is it possible to do with your code??
Suppose this, I have entered in the array this code..
var customarray=new Array('hotmail.com','yahoo.com');
What I want this :
When the user type martin@hot--> apperars in the windows “ hotmail.com”, then the user select the correct option and then add his selection to the userEmnail
Ex martin@hot
add martin@hotmail.com
Appears hotmail.com
hello sir
we are college students.I read your abstract .
very nice.we need a project details on IMAGEZIPPING by today
please help us
please send the details to shibaji4219@yahoo.co.in
I've only been testing it in firefox though, and when I went to use it in IE (6), i noticed that the list shows up BEHIND other select dropdown boxes on the form page I'm using.
I've tried various things like setting a, r, and c.zIndex to be 5 and the select to be 1, and I've read some things about iframes, but I'm wondering if anyone knows of a more elegant solution or something I should investigate concerning this.
This is because SELECT elements in IE 6 and earlier are implemented as so-called "windowed" controls. Windowed controls ignore z-index and always appear in front. iframes are also windowed controls, and it sounds like one hack you've stumbled onto suggests using iframes to get things to show up in front of the pesky SELECT controls. The other workarounds I've seen are (a) hide all SELECTs on the form whenever anything is displayed that *might* be obstructed (ugly), (b) modify the form layout so SELECTs are never in the way.
I'm trying to append the "," after an item has been selected. Could someone show me how to do that or show me the code where it's returning the item? Thanks...
(1) In actb.js, ensure delimiters initialized: this.actb_delimiter = new Array(';', ',');
(2) In actb.js, add a new parameter to function actb() as actb(obj, ca, mouseSelectCallback);
fire this callback at the end of actb_mouseclick like this:
// The click event handler for the suggest table.
function actb_mouseclick(evt)
{
...
// Callback is fired when selection is made by mouse.
if (mouseSelectCallback)
{
mouseSelectCallback(actb_curr);
}
}
(3) Define these functions in your own script:
<script language="javascript">
function mouseSelectCallback()
{
// Append "," after a selection is made.
var textbox = document.getElementById('myTextbox');
textbox.value += ",";
}
function onKeyUpHandler(textbox, evt)
{
var keyCode;
if (window.event) keyCode = window.event.keyCode;
else if (evt && evt.which) keyCode = evt.which;
else if (evt && evt.charCode) keyCode = evt.charCode;
// Enter and Tab key are the selection keys.
if (keyCode == 13 || keyCode == 9)
mouseSelectCallback();
}
function enableACTB(textbox)
{
var obj = actb(textbox, myArray, mouseSelectCallback);
}
</script>
(4) Respond to these events of your textbox:
<input type="text" id="myTextbox" onkeyup="onKeyUpHandler(this, event);"
onfocus="enableACTB(this);">
Hope this helps.
Richard Xiong
-- modified at 15:55 Friday 14th September, 2007
Last Visit: 31-Dec-99 18:00 Last Update: 26-Sep-24 17:08