Re: [web2py] Re: list:reference painfull to fill

2013-12-14 Thread Richard Vézina
In the view something like that : $( document ).ready(function() { $('input#id').bsmselect(...); }); It can be pass to the view from the controller, as you want... So you will need to do something like that : {{=XML(your_pass_js_script)}} :) Richard On Fri, Dec 13, 2013 at 6:38 PM,

Re: [web2py] Re: list:reference painfull to fill

2013-12-14 Thread Richard Vézina
I forget... Don' forget to surround with script/script tag... script {{=XML(your_pass_js_script)}} /script On Sat, Dec 14, 2013 at 3:17 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: In the view something like that : $( document ).ready(function() {

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Kevin Bethke
thanks but to be honest now I'm even more confused. why do you need a piece of jquery code in a javascript variable. I sopose you included the entire jquery library. Why do you do the ordering with javascript and not with python is there a special reason for this? I think I just explained the last

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Richard Vézina
I am sorry about that... Web2py default behavior for list:reference or reference is a HTML Select and option... This is ordered by the navigator base on the spelling of the element... So when you edit your form if you want to maintain the preexisting order (the one that were there when you select

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Kevin Bethke
Thanks it explains a lot. I will try to work on it as soon as I got the time. Unfortunatly we got a deadline at work which is Christmas. So I will probably not work on it till than. On Fri, Dec 13, 2013 at 3:53 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: I am sorry about that...

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Kevin Bethke
Well actually I got one more question: How do you change the standard form from web2py, to use the bsmselect form? On Fri, Dec 13, 2013 at 4:18 PM, Kevin Bethke kevin.bet...@gmail.comwrote: Thanks it explains a lot. I will try to work on it as soon as I got the time. Unfortunatly we got a

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Richard Vézina
You init the js on the field!! Richard On Fri, Dec 13, 2013 at 10:20 AM, Kevin Bethke kevin.bet...@gmail.comwrote: Well actually I got one more question: How do you change the standard form from web2py, to use the bsmselect form? On Fri, Dec 13, 2013 at 4:18 PM, Kevin Bethke

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Jesse Ferguson
sorry to hop in and ask a silly question but, when you say init the js on the field how is that supposed to be done in web2py? Is it done in the view? would it be ideal to put the js in the template and then pass params? any named optional attribute is passed to the form tag for

[web2py] Re: list:reference painfull to fill

2013-12-12 Thread BlueShadow
thanks for your offer I'm working my way through the example code but my biggest problem is that php site. I don't know php. But from what I get from the php code is that all the sample cities need to be in an unordered list environment ulli/li.../ul but this form part of the bsmselect example

Re: [web2py] Re: list:reference painfull to fill

2013-12-12 Thread Richard Vézina
Don't bother with the php thing... Just look the data structure of the select... Here what I do to restore proper order on update form : controller_view_js += var ordered_values = ''%s''; $(document).ready(function() { if(ordered_values != None) { $.each(ordered_values, function(i,

Re: [web2py] Re: list:reference painfull to fill

2013-12-12 Thread Richard Vézina
It's a bit hacky but it works... :) Richard On Thu, Dec 12, 2013 at 9:48 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Don't bother with the php thing... Just look the data structure of the select... Here what I do to restore proper order on update form : controller_view_js +=