No JS errors.  The code executes successfully.  The call to 
RecordSelect.render_page... does not create an error.  I copied the line 
from the Network request and pasted it in the console and it executes.  I 
opened the gem and found this

RecordSelect.render_page = function(record_select_id, page) {
  jQuery('#' + record_select_id + ' ol').first().replaceWith(page);
};

I did the jquery selector on the console and it is finding the element.  I 
think the problem has already occurred so the dom modification is fine, the 
css was not tweaked earlier so the drop down is not visible.

That happens when the input gets focus and it calls 

browse?search=

I see the partial (not javascript but html fragment) of the form with the 
<ol> beneath it from the network return but that does not display on the 
screen in the error case.  I'm not sure what is catching that 
browse?search= return but that is where the error happens.

One other point is the same controller allows update on existing records. 
 Those work.  It's only the create with a blank input that creates the 
problem.

This is the top of that fragment

<div class="record-select" id="record-select-admin_zen_products">
  <form accept-charset="UTF-8" 
action="/admin/zen_products/browse?page=1&amp;search=&amp;update=1" 
data-remote="true" id="record-select-admin_zen_products-search" 
method="get"><div style="margin:0;padding:0;display:inline"><input 
name="utf8" type="hidden" value="&#x2713;" /></div>  <input 
autocomplete="off" class="text-input" id="search" name="search" type="text" 
value="" />
  <input class="search_submit" name="commit" type="submit" value="search" />
</form>

  <ol>
  <li class="found">3345 zen product found</li>
  <li class="record odd" id="rs5596">
    WIR047 (0.0) -  14g FINE Silver round, dead soft wire - 1 ft 
  ...
lots more



On Tuesday, March 24, 2015 at 1:56:01 AM UTC-7, Sergio Cambra wrote:
>
>  Do you get any JS error on web inspector console?
>
>  
>
> El Lunes, 23 de marzo de 2015 12:47:09 mvargo escribió:
>
> > I am having similar erratic behavior with the record_select feature. The
>
> > issue is that I can see the calls to the browse function on the 
> controllers
>
> > and I see the return with the javascript to call
>
> > RecordSelect.render_page('record-select-admin_zen_products...
>
> > but the UI does not show up. I don't see an error in the javascript
>
> > console either.
>
> > 
>
> > It does not happen all the time. The site I'm working on was up for a 
> week
>
> > and being used every day and then started to fail. Feels like a client
>
> > side timing issue.
>
> > 
>
> > I upgraded to latest jQuery and did a bundle update so have new active
>
> > scaffold.
>
> > 
>
> > Any ideas?
>
> > 
>
> > Gemfile:
>
> > 
>
> > gem 'rails', '3.2.21'
>
> > gem 'mysql2'
>
> > gem 'active_scaffold'
>
> > ...
>
> > gem 'recordselect'
>
> > ...
>
> > gem 'jquery-rails'
>
> > gem 'jquery-ui-rails'
>
> > # To support jquery-tools, but not included in admin ux
>
> > gem 'jquery-migrate-rails'
>
> > 
>
> > 
>
> > Gemfile.lock extracts
>
> > 
>
> > active_scaffold (3.4.18.1)
>
> > rails (>= 3.2.18, < 5)
>
> > 
>
> > recordselect (3.4.4)
>
> > rails (>= 3.1.3)
>
> > 
>
> > jquery-rails (3.1.2)
>
> > railties (>= 3.0, < 5.0)
>
> > thor (>= 0.14, < 2.0)
>
> > jquery-ui-rails (5.0.3)
>
> > railties (>= 3.2.16)
>
> > 
>
> > admin.js.erb
>
> > 
>
> > //= require jquery
>
> > //= require jquery-ui
>
> > //= require jquery_ujs
>
> > //= require jquery.ui.nestedSortable
>
> > //= require sortable_tree/initializer
>
> > //= require active_scaffold
>
> > //= require record_select
>
> > 
>
> > On Tuesday, December 30, 2014 at 4:27:29 PM UTC-8, coalex wrote:
>
> > > Hey Serg,
>
> > > I wanted to have an autocomplete field on a few forms where the drop 
> downs
>
> > > are getting too long.
>
> > > So...
>
> > > I got recordselect working, but the list of options do not dynamically
>
> > > update as I type in the form field.
>
> > > There are no obvious errors in the console.
>
> > > Any ideas, Thank you!!
>
> > > 
>
> > > Started GET "/locationtypes/browse?search=" for 127.0.0.1 at 2014-12-30
>
> > > 17:22:05 -0700
>
> > > Processing by LocationtypesController#browse as */*
>
> > > 
>
> > > Parameters: {"search"=>""}
>
> > > 
>
> > > (1.0ms) SELECT COUNT(*) FROM "locationtypes"
>
> > > 
>
> > > Rendered
>
> > > 
>
> > > .../gems/recordselect-d5ed9fff0efc/app/views/record_select/_
> search.html.er
>
> > > b
>
> > > (1.0ms)
>
> > > 
>
> > > Locationtype Load (2.0ms) SELECT "locationtypes".* FROM "locationtypes"
>
> > > 
>
> > > ORDER BY name LIMIT 12 OFFSET 0
>
> > > 
>
> > > Rendered
>
> > > 
>
> > > 
> .../gems/recordselect-d5ed9fff0efc/app/views/record_select/_list.html.erb
>
> > > (5.0ms)
>
> > > 
>
> > > Rendered
>
> > > 
>
> > > .../gems/recordselect-d5ed9fff0efc/app/views/record_select/_
> browse.html.er
>
> > > b
>
> > > (17.0ms)
>
> > > Completed 200 OK in 83.0ms (Views: 73.0ms | ActiveRecord: 5.0ms)
>
> > > 
>
> > > Rails 3.2.17
>
> > > active_scaffold (3.3.3)
>
> > > recordselect 3.4.3 from git://github.com/scambra/recordselect.git (at
>
> > > master)
>
> > > jquery-rails 3.0.4
>
> > > jquery-ui-rails 4.1.0
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to