[web2py] Re: _onkeyup / ajax call

2015-10-15 Thread Mark Billion
Tried, but had problems with longer ones

j_query_calls = """https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js";>
"""
row_adder = """

$( document ).ready(function() {
$('#Debts_creditor__row').after('Suggested Creditors
'); $( "#Debts_creditor" ).keyup(function() { ajax('%s', ['creditor'], 'suggestions'); });}); """ %URL('default', 'cred_selector') return '%s%s%s' %(j_query_calls,row_adder, ajax_form) On Wednesday, October 14, 2015 at 8:24:58 PM UTC-4, Dave S wrote: > > > > On Wednesday, October 14, 2015 at 2:30:03 PM UTC-7, Mark Billion wrote: >> >> NM. I injected the jquery into the header. >> > > Element selection? > > /dps > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

[web2py] Re: _onkeyup / ajax call

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 2:30:03 PM UTC-7, Mark Billion wrote:
>
> NM.  I injected the jquery into the header.  
>

Element selection?

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: _onkeyup / ajax call

2015-10-14 Thread Mark Billion
NM.  I injected the jquery into the header.  

On Wednesday, October 14, 2015 at 2:22:39 PM UTC-4, Mark Billion wrote:
>
> Im pulling my hair out. . . . 
>
> Im using an inline call to the web2py ajax function via the controller as 
> below:
>
> ajax_form.element('#Debts_creditor')['_onkeyup'] = 
> "ajax('https:.../t2/default/cred_selector', ['creditor'], 'suggestions');"
>
> The goal is for this ajax call to control a div that I am inserting in a 
> dynamically created iframe div, per below.
>
> Ive been at this for two days and cannot for the life of me figure out 
> what Im doing wrong.  Any help would be much appreciated.
>
> 
> 
> $('.iframe_input').click(function(){
> var element = $(this).attr('name');
> $('#iframe_target').html('');
> 
> });
> 
> 
> function row_adder() {
> 
> var iframe = document.getElementById('myFrame'),
> iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
> $(iframeDoc).find('#Debts_creditor__row').after(' id="suggestions">here');
> 
> }
> 
> 
>
>
>
> def cred_selector():
> if not request.vars.creditor:
> return ""
> else:
> click_string = "jQuery('#Debts_creditor').val('%s'); 
> jQuery('#Debts_street_1').val('%s'); \
> jQuery('#Debts_street_2').val('%s'); 
> jQuery('#Debts_zip_code').val('%s')"
>
> pattern = request.vars.creditor + '%'
> selected = [[row.creditor, row.street_1, row.street_2, 
> row.zip_code] for row in 
> db(db.preferred_creditor.creditor.like(pattern)).select()]
> 
> return ''.join([DIV(k[0], _onclick=click_string %(k[0], k[1], 
> k[2], k[3]), 
> 
> _onmouseover="this.style.backgroundColor='grey'",
> 
> _onmouseout="this.style.backgroundColor='white'").xml() for k in selected])
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.