Re: [web2py] Re: REF: Component + Javascript

2013-04-18 Thread Niphlod
you can't load a html fragment at wish. The second LOAD is found, it 
triggers the loading: it's not the way to do it.

Still, until you can't find out why you can't attach an event to your 
button, all the remains of the discussion is useless: let's start simple 
(single button in the page), then go all the way up to your grid, finding 
where your event gets not fired.

On Thursday, April 18, 2013 7:48:37 AM UTC+2, software.ted wrote:

 The button has a href=#mymodal calling a modal window. What I want is to 
 pass an ID to the modal window. I have a LOAD() in the modal window. so in 
 essence the situation is i have a grid listing with each row a button, then 
 click a button calls a modal window which has a div 
 id=mp_xx{{=LOAD('c','a', args='x')}}/div. Now when a user clicks on 
 the button i want to change the contents of the div using 
 jQuery('#id_xx').html({{=LOAD('c','a', args=var)}}). Maybe there is 
 another way of doing this??? Please advise.


 On Wed, Apr 17, 2013 at 2:18 PM, Niphlod nip...@gmail.com 
 javascript:wrote:

 are you sure that the button has not yet an event attached that prevents 
 your custom one ?


 On Wednesday, April 17, 2013 12:15:03 PM UTC+2, software.ted wrote:

 I have a component am loading in a div
 div id=test/div
 {{=A('Link to comp', component=URL('research', 'mycomponent.load'), 
 target='setting-content')}}

 div class=span8 id=setting-content

  /div

 in this same view page i have a javascript

 script type=text/javascript
   jQuery('#mp_257').click(**function(){
 jQuery('#test').html('Test')
 //alert(Test)
   })
 /script

 The component has a button with an id=mp_257, but when i click on it, 
 jQuery in the view above is not being executed by replacing the Text in 
 the div...the component has a grid with a custom button created as follows:

 links = [lambda row: A(SPAN(_class='icon-pencil'), 'Personal Details', 
 _id = 'mp_257', _class='btn')]

 Anything why this is not working? But when I put the button in the view 
 using:

 {{=A(SPAN(_class='icon-pencil'**), 'Personal Details', _id = 'mp_257', 
 _class='btn')}}

 All works fine, is there something about loaded component that prevents 
 running of javascript in the same page?

 -- 
 ..**..**
 ...
 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he 
 is all - Thomas Carlyle 1795-1881

 /~ 

  -- 
  
 --- 
 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+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




 -- 

 ...
 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he is 
 all - Thomas Carlyle 1795-1881

 /~ 


-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: REF: Component + Javascript

2013-04-18 Thread Teddy Nyambe
Ok let me start simple see where i get. Will share what i get


On Thu, Apr 18, 2013 at 9:34 AM, Niphlod niph...@gmail.com wrote:

 you can't load a html fragment at wish. The second LOAD is found, it
 triggers the loading: it's not the way to do it.

 Still, until you can't find out why you can't attach an event to your
 button, all the remains of the discussion is useless: let's start simple
 (single button in the page), then go all the way up to your grid, finding
 where your event gets not fired.


 On Thursday, April 18, 2013 7:48:37 AM UTC+2, software.ted wrote:

 The button has a href=#mymodal calling a modal window. What I want is
 to pass an ID to the modal window. I have a LOAD() in the modal window. so
 in essence the situation is i have a grid listing with each row a button,
 then click a button calls a modal window which has a div
 id=mp_xx{{=LOAD('c','a', args='x')}}/div. Now when a user clicks on
 the button i want to change the contents of the div using
 jQuery('#id_xx').html({{=**LOAD('c','a', args=var)}}). Maybe there is
 another way of doing this??? Please advise.


 On Wed, Apr 17, 2013 at 2:18 PM, Niphlod nip...@gmail.com wrote:

 are you sure that the button has not yet an event attached that prevents
 your custom one ?


 On Wednesday, April 17, 2013 12:15:03 PM UTC+2, software.ted wrote:

 I have a component am loading in a div
 div id=test/div
 {{=A('Link to comp', component=URL('research', 'mycomponent.load'),
 target='setting-content')}}

 div class=span8 id=setting-content

  /div

 in this same view page i have a javascript

 script type=text/javascript
   jQuery('#mp_257').click(**functi**on(){
 jQuery('#test').html('Test')
 //alert(Test)
   })
 /script

 The component has a button with an id=mp_257, but when i click on it,
 jQuery in the view above is not being executed by replacing the Text in
 the div...the component has a grid with a custom button created as follows:

 links = [lambda row: A(SPAN(_class='icon-pencil'), 'Personal Details',
 _id = 'mp_257', _class='btn')]

 Anything why this is not working? But when I put the button in the view
 using:

 {{=A(SPAN(_class='icon-pencil'), 'Personal Details', _id =
 'mp_257', _class='btn')}}

 All works fine, is there something about loaded component that prevents
 running of javascript in the same page?

 --
 ....
 ...
 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he
 is all - Thomas Carlyle 1795-1881

 /~

  --

 ---
 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+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .






 --
 ..**..**
 ...
 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he is
 all - Thomas Carlyle 1795-1881

 /~

  --

 ---
 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/groups/opt_out.






-- 
...
Teddy Lubasi Nyambe
Opensource Zambia
Lusaka, ZAMBIA

Cell: +260 97 7760473
website: http://www.opensource.org.zm

~/
Human Knowledge belongs to the world! - AntiTrust

Man is a tool-using animal. Without tools he is nothing, with tools he is
all - Thomas Carlyle 1795-1881

/~

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: REF: Component + Javascript

2013-04-17 Thread Teddy Nyambe
No luck, still quiet no activity. How can i debug jQuery?


On Wed, Apr 17, 2013 at 12:20 PM, Niphlod niph...@gmail.com wrote:

 you're attaching a jquery event to an element that when the script is
 executed is not yet present (it's loading...)

 try to rewrite your

 script type=text/javascript
   jQuery('#mp_257').click(**function(){
 jQuery('#test').html('Test')
 //alert(Test)
   })
 /script

 to

 script type=text/javascript
   jQuery(document).on('click', '#mp_257', function(){
 jQuery('#test').html('Test')
 //alert(Test)
   })
 /script



 On Wednesday, April 17, 2013 12:15:03 PM UTC+2, software.ted wrote:

 I have a component am loading in a div
 div id=test/div
 {{=A('Link to comp', component=URL('research', 'mycomponent.load'),
 target='setting-content')}}

 div class=span8 id=setting-content

  /div

 in this same view page i have a javascript

 script type=text/javascript
   jQuery('#mp_257').click(**function(){
 jQuery('#test').html('Test')
 //alert(Test)
   })
 /script

 The component has a button with an id=mp_257, but when i click on it,
 jQuery in the view above is not being executed by replacing the Text in
 the div...the component has a grid with a custom button created as follows:

 links = [lambda row: A(SPAN(_class='icon-pencil'), 'Personal Details',
 _id = 'mp_257', _class='btn')]

 Anything why this is not working? But when I put the button in the view
 using:

 {{=A(SPAN(_class='icon-pencil'**), 'Personal Details', _id = 'mp_257',
 _class='btn')}}

 All works fine, is there something about loaded component that prevents
 running of javascript in the same page?

 --
 ..**..**
 ...
 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he is
 all - Thomas Carlyle 1795-1881

 /~

  --

 ---
 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/groups/opt_out.






-- 
...
Teddy Lubasi Nyambe
Opensource Zambia
Lusaka, ZAMBIA

Cell: +260 97 7760473
website: http://www.opensource.org.zm

~/
Human Knowledge belongs to the world! - AntiTrust

Man is a tool-using animal. Without tools he is nothing, with tools he is
all - Thomas Carlyle 1795-1881

/~

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: REF: Component + Javascript

2013-04-17 Thread Teddy Nyambe
The button has a href=#mymodal calling a modal window. What I want is to
pass an ID to the modal window. I have a LOAD() in the modal window. so in
essence the situation is i have a grid listing with each row a button, then
click a button calls a modal window which has a div
id=mp_xx{{=LOAD('c','a', args='x')}}/div. Now when a user clicks on
the button i want to change the contents of the div using
jQuery('#id_xx').html({{=LOAD('c','a', args=var)}}). Maybe there is
another way of doing this??? Please advise.


On Wed, Apr 17, 2013 at 2:18 PM, Niphlod niph...@gmail.com wrote:

 are you sure that the button has not yet an event attached that prevents
 your custom one ?


 On Wednesday, April 17, 2013 12:15:03 PM UTC+2, software.ted wrote:

 I have a component am loading in a div
 div id=test/div
 {{=A('Link to comp', component=URL('research', 'mycomponent.load'),
 target='setting-content')}}

 div class=span8 id=setting-content

  /div

 in this same view page i have a javascript

 script type=text/javascript
   jQuery('#mp_257').click(**function(){
 jQuery('#test').html('Test')
 //alert(Test)
   })
 /script

 The component has a button with an id=mp_257, but when i click on it,
 jQuery in the view above is not being executed by replacing the Text in
 the div...the component has a grid with a custom button created as follows:

 links = [lambda row: A(SPAN(_class='icon-pencil'), 'Personal Details',
 _id = 'mp_257', _class='btn')]

 Anything why this is not working? But when I put the button in the view
 using:

 {{=A(SPAN(_class='icon-pencil'**), 'Personal Details', _id = 'mp_257',
 _class='btn')}}

 All works fine, is there something about loaded component that prevents
 running of javascript in the same page?

 --
 ..**..**
 ...
 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he is
 all - Thomas Carlyle 1795-1881

 /~

  --

 ---
 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/groups/opt_out.






-- 
...
Teddy Lubasi Nyambe
Opensource Zambia
Lusaka, ZAMBIA

Cell: +260 97 7760473
website: http://www.opensource.org.zm

~/
Human Knowledge belongs to the world! - AntiTrust

Man is a tool-using animal. Without tools he is nothing, with tools he is
all - Thomas Carlyle 1795-1881

/~

-- 

--- 
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/groups/opt_out.