Thursday, 15 August 2013

jquery - jrails autocomplete selection problems with DIVs or anything else -


I'm just starting to use jRails and jRails auto_complete assistant

I used to use prototype before using the default auto_complete assistant and leaving the hovering on the results of autocomplete, drops in properly worked with JRless if you use simple text for the result, Works but I'm using several divisions in my partial form Which generates output to auto-complete.

  & lt; Li class = "location" & gt; & Quot; Div class = "picture" & gt; & Lt; Img src = "/ images / flags /" & lt;% = h image% & gt; .png "/> & Lt; / Div & gt; & Lt; Div class = "name" & gt; & Lt;% = h place Keyword = & gt ;, & lt; / Div & gt; & Lt; Div class = "country" & gt; & Lt;% = h location.sideinfo% & gt; & Lt; / Div & gt; & Lt; / Li & gt;  

It looks the same and all CSS works and looks like before, but the result is a selection or hovering over. This allows only selection if you hover over the background around the text ... Anything in a tag, (div, span, etc.) goes to the hover to go and clicking it does not text the textbox Is added.

Is anyone else having such problems?

I know for a while, but I hit the same problem today itself.

The mousewoucher incites the mouse to the event with all these items, which is clearly not the lack of self-integral property (it is employed only on light elements. Therefore, when the indicator is from one of the children One,

  onHover: function (e) {var my_index = e.target.autocompleteIndex; if (if! My_index) {my_index = $ (e.target) .closest ('li' Attr ('autocompleteIndex');} if (this.index! = My_index) {this.index = my_index; this.render ();} stop event (e);},  

Now if we have an autoplay index property in that element If we fail to know who is removed from the mouseover event, then we look at the nearest parent of 'Li' and use anything present there.

There is a little regret, but at least Worked for me.

On a sidenote, I also had clicked on tickling, or when I clicked the mouse and hit one, say, div element, the index was lost. That's why it was in the first place, so in the keyboard interface Nothing is included.

  onClick: function (e) {/enthis.index = e.target. Auto integer index * / This.selectEntry (); This.hide (); },  

No comments:

Post a Comment