|
Hi Marco,
Marco2250 wrote: Great work man. Congratulations!
Thanks a lot!
Marco2250 wrote: But, I have one suggestion: The possibility of assigning a value for each item. So, I can use it to store entity key values.
That is the 2nd time this suggestion arises. Looks like it is really useful Will do it on the next update (due to Sept 28th).
Best regards,
- Dmitry.
P.S. If it won't bother you, can you please vote for this article in the CodeProject's Monthly Survey:
http://www.codeproject.com/script/survey/survey.asp?survey=721
Thank you very much in advance!
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Of course it doesn't bother me.
I've voted!
Regards,
Marco Alves.
|
|
|
|
|
Thank you, Marco!
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Nice article
Thanks Dmitry ...
|
|
|
|
|
|
Thanks for the article!
Just wondering if the next version is ready? (with the new suggestions as in the messages)
Rochana
|
|
|
|
|
Hi Rochana,
rochana_bg wrote: Just wondering if the next version is ready? (with the new suggestions as in the messages)
I've sent the updated script and article to CodeProject administrators several hours ago. Please allow some time (usually from 10 hours to several days) to update the article (taking into account is that the update is quite big ).
- Dmitry.
P.S. If it won't bother you, can you please vote for this article in the CodeProject's Monthly Survey:
http://www.codeproject.com/script/survey/survey.asp?survey=721
Thank you very much in advance!
P.P.S. If you're impatient to see the new version - feel free to e-mail me, I'll send it to you.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Article updated, enjoy
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Great work thank you !
However I had some problems while playing with actb_lim on this version.
When I set actb_lim to -1, IE7 generates a javascript error on line 241.
I simply changed on line 241 :
if(this.actb_useScroll && (this.actb_total > this.actb_lim))
to
if(this.actb_useScroll && (this.actb_total > this.actb_lim) && (this.actb_lim > 0))
to make it work again. I think actb_lim = 0 should be treated the same way as actb_lim = -1 ...
But there was another problem when I set actb_lim to -1 and actb_useScroll to false : no list appears (it's empty) !
So I added "&& (this.actb_total > this.actb_lim)" to lines 275, 334, 369 and 424
and changed line 291 from
if(this.actb_bool[i] && (this.actb_useScroll || (counter < this.actb_lim)))
to
if(this.actb_bool[i] && (this.actb_useScroll || (counter < this.actb_lim) || (this.actb_lim <= 0)))
and now it seems to work better ...
Hope it's correct and it helped !
|
|
|
|
|
Hi,
thanks for your bugreport & corrections - I'll look into it. Next update (due to Sept 28th) will include these fixes.
BTW, can you please vote for this article in the CodeProject's Monthly Survey:
http://www.codeproject.com/script/survey/survey.asp?survey=721
Thank you very much in advance!
-- modified at 3:08 Tuesday 25th September, 2007
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanks for a great update!
One little thing, with this version I get javascript errors on row 1067 "Event has no properties", They seem to come everytime I step down in the list of suggestions.
|
|
|
|
|
jimmiea wrote: One little thing, with this version I get javascript errors on row 1067 "Event has no properties", They seem to come everytime I step down in the list of suggestions.
Thanks for bugreport, I'll investigate it.
Meanwhile, can you please vote for this article in CodeProject's Monthly Survey:
http://www.codeproject.com/script/survey/survey.asp?survey=721
Thank you very much in advance!
- Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
ok, I voted
|
|
|
|
|
Thanks a lot!
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi !
One more suggestion - not to restrict the user by hard coded selection algorithm.
For now your script uses suggesturl only once for the first letter, and then it is your script, that decides how to shorten the display list.
It may be enough in simple cases, but doesn't satisfy the most real cases, especially when using languages other than English (it has not be surprise for you, that there are languages besides English ).
So I'd suggest to add the public boolean property, say actb_fullrefresh, and in the case of actb_fullrefresh==true, request the list from the server for every new keycode, passing in URL the full already entered string. For example:
<br />
else if((ot.length == 1) || actb_fullrefresh ||<br />
((ot.length > 1) && !this.actb_keywords.length) ||<br />
((ot.length > 1) && (this.actb_keywords[0].substr(0, 1) != ot.substr(0, 1))))<br />
{<br />
var ot_ = ((ot.length > 1) && (!actb_fullrefresh)) ? ot.substr(0, 1) : ot;<br />
Regards,
Gennady
|
|
|
|
|
Hi and great work on the code.
I'm having difficulty implementing it on a page where there is more then input field using the autosuggest (actb object).
How do I go about it?
|
|
|
|
|
1)
After I sat down and thought about it, it came to me:
added variable:
this.suggesturl
The function within autosuggest.js now would look like this:
function actb(id, ca,surl)
{
// Public Variables:
this.suggesturl = surl;
...
}
When the object is created, I pass the suggesturl value, in this example: './contact1_get.php' passed to surl above and then passed to this.suggesturl
new actb('Contact1', '', './contact1_get.php?');
This means that wherever suggesturl is referenced , i reference instead this.suggesturl
2)
One thing I noticed , separate from this immediate topic, is the Iframe option does not seem to fix the controls showing through the list ... so i make use of addition code to hide these controls. What am I doing wrong?
Best Regards and thank you.
|
|
|
|
|
Hi Alfonso,
alfonsopilato wrote: When the object is created, I pass the suggesturl value, in this example: './contact1_get.php'
new actb('Contact1', '', './contact1_get.php?');
This feature (distinct suggestion server url) will be added in next release.
alfonsopilato wrote: One thing I noticed , separate from this immediate topic, is the Iframe option does not seem to fix the controls showing through the list ... so i make use of addition code to hide these controls. What am I doing wrong?
Oops! I checked this too, and IFrame option, strangely enough, didn't work
I'm investigating this and post a solution as soon as I get it working.
- Dmitry.
P.S. BTW, could you please vote for this article in a CP Monthly survey:
http://www.codeproject.com/script/survey/survey.asp?survey=721
Thank you much in advance!
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
The beginning of the actb_generate method, i.e. everything before the line:
var first = true, j = 1; should be:
if(document.getElementById('tat_table_' + this.actb_base_id))
{
this.actb_display = false;
document.body.removeChild(document.getElementById('tat_table_' + this.actb_base_id));
}
if(this.actb_total == 0)
{
this.actb_display = false;
return;
}
var msie = (document.all && !window.opera) ? true : false;
var bb = document.createElement('div');
bb.id = 'tat_table_' + this.actb_base_id;
bb.style.position = 'absolute';
bb.style.border = '#000000 solid 1px';
this.cur_y = bb.style.top = eval(curTop(this.actb_curr) + this.actb_curr.offsetHeight) + "px";
this.cur_x = bb.style.left = curLeft(this.actb_curr) + "px";
this.cur_w = bb.style.width = this.actb_curr.offsetWidth + "px";
var cc = null;
if(msie && this.actb_useIFrame)
{
var cc = document.createElement('iframe');
cc.src = "";
cc.scrolling = "no";
cc.frameBorder = "0";
cc.style.position = "absolute";
cc.style.zIndex = 0;
cc.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);";
}
var a = document.createElement('table');
a.cellSpacing ='1px';
a.cellPadding ='2px';
a.style.width = "100%";
a.style.backgroundColor = this.actb_bgColor;
a.id = 'tat_table2_' + this.actb_base_id;
if(this.actb_useScroll && (this.actb_total > this.actb_lim))
{
this.cur_h = bb.style.height = (this.actb_lim * parseInt(this.actb_fSize) + 3) + 2 + "px";
bb.style.overflow = "auto";
bb.style.overflowX = "hidden";
}
this.cur_y = parseInt(this.cur_y);
this.cur_h = parseInt(this.cur_h);
this.cur_x = parseInt(this.cur_x);
this.cur_w = parseInt(this.cur_w);
document.body.appendChild(bb);
if(cc)
{
cc.style.top = a.offsetTop;
cc.style.left = a.offsetLeft;
bb.appendChild(cc);
}
bb.appendChild(a); This fix will be included in the next release. Sorry for inconvenience.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dimitri,
The fix works fine in the sense that controls behind the list do not poke through.
However it appears that mouse control (clicking to select) is disabled when I make use of this iFrame option.
I'm running I.E. 6.0.2800.1106 with SP1
|
|
|
|
|
The lines:
cc.style.zIndex = 0;
cc.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);";
should be:
cc.style.zIndex = -1;
cc.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=0);";
This fixes the problem.
- Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
1) Great stuff re. distinct suggestion server url and BTW fix for the iFrame works great, HOWEVER it appears that when iFrame is enabled mouse control does not work (i.e cannot select an item rom the suggestions list using the mouse).
2) I got the three inputs using the autosuggest work fine with each their own distinct suggestion srever url, however I think I got this to work only by pure ingorance on my part. It works fine, however when I place an alert and inspect the url for each input, the last declared input's suggestion server url is what i see.. oddly enough it works :s
Will be looking forward to your upgrade so that I may see where I could have made improvements to my makeshift workaround.
Cheers.
-- modified at 22:55 Monday 17th September, 2007
|
|
|
|
|
First of all - good work. You've got my 5 points and vote.
Some suggestions though for future releases:
1. It would be better to make global variable suggesturl the actb public property.
It will be very useful for multiple controls on the same page.
2. In real life we very often are getting the user friendly input from GUI, but inside the application are using codes. In the case of select element it is simple with the value attribute. It would be very useful to have similar option in your control too.
3. It is the advantage of your control that it is pure Javascript and doesn't use the AJAX libraries, cumbersome as every common thing. But it will be the additional advantage, if you'll convert it to server control. It will not loose it's run time simplicity, but will be much more comfortable in definition and distribution.
For me the point 2 is the most important. I cannot use your control without it, and unfortunately I have no time just now to do it myself.
Thanks.
Regards,
Gennady
|
|
|
|
|
Hi Gennady,
Gennady Oster wrote: First of all - good work. You've got my 5 points and vote.
Thanks a lot!
Gennady Oster wrote: 1. It would be better to make global variable suggesturl the actb public property.
Will do it.
Gennady Oster wrote: 2. In real life we very often are getting the user friendly input from GUI, but inside the application are using codes. In the case of select element it is simple with the value attribute. It would be very useful to have similar option in your control too.
Will do it also in the next update (Sept. 20th)
Gennady Oster wrote: 3. It is the advantage of your control that it is pure Javascript and doesn't use the AJAX libraries, cumbersome as every common thing. But it will be the additional advantage, if you'll convert it to server control. It will not loose it's run time simplicity, but will be much more comfortable in definition and distribution.
It will be done, but in a (near) future. I'm learning ASP.NET intensively, so let's hope I'll come to it. But - I won't "convert", but create a separate package with a ASP.NET control.
Best regards,
- Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi !
Dmitry Khudorozhkov wrote: Will do it also in the next update (Sept. 20th)
OK, thanks, shall wait it impatiently.
Dmitry Khudorozhkov wrote: But - I won't "convert"
Sure, "convert" is figuratively.
Don't forget to include the style attributes in the public properties of the control.
And BTW, may be it has sense to add the Css class property to actb object, as alternative (not substitute) to the multiple style attributes.
Regards,
Gennady
|
|
|
|
|