[web2py] Re: fighting with the widget

2016-03-19 Thread Pierre
ok ..I don't want to spend too much efforts on a widget so I am making a simple function derived from ListWidget classmethod. I cloned he original ul.w2p_list css only changing its name, so far everything works -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - htt

[web2py] Re: fighting with the widget

2016-03-19 Thread Leonel Câmara
It's enough to use just a function. However if you want your widget to be configurable you could use a function that returns a function for a widget and you would make widget=function_that_returns_a_function(**my_widget_options). Another alternative is to have a class and set class attributes

[web2py] Re: fighting with the widget

2016-03-19 Thread Pierre
thanks Val K still there's something unclear: the book implies that a new widget is just a function and a field definition bound to that function like: def my_string_widget(field, value): return INPUT(_name=field.name, _id="%s_%s" % (field._tablename, field.name),

[web2py] Re: fighting with the widget

2016-03-15 Thread Val K
There is no problem with bootstrap - you can write your own widgets using its classes, but if you customize/override web2py.js/web2py-bootsrup3.js/widgtes.py you have a chance to get a pain with updating web2py (bootstrap is updated much rarely) optimal solution (I think) - write your own

[web2py] Re: fighting with the widget

2016-03-15 Thread Pierre
If I want to define another class like class MyListWidget(StringWidget): what's the location to put this code ? -- 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 Issu

[web2py] Re: fighting with the widget

2016-03-15 Thread Pierre
thank you guys !!! I should be able to fix things tomorrow.for the moment am staying with bootstrap classes -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues

[web2py] Re: fighting with the widget

2016-03-15 Thread Val K
OOPs! I make my widgets exactly this way (another class), but Pierre wants to customize existing - let's give him a chance ;) On Tuesday, March 15, 2016 at 11:52:22 PM UTC+3, Niphlod wrote: > > actually you picked up a good example on how to override properly > web2py.js the new scaffoldin

[web2py] Re: fighting with the widget

2016-03-15 Thread Niphlod
actually you picked up a good example on how to override properly web2py.js the new scaffolding app overwrites the default string widget with one that is more in line with bootstrap3 (see welcome/static/js/web2py-bootstrap3.js). anyhow, if you want no interactions whatsoever with web2py.js

[web2py] Re: fighting with the widget

2016-03-15 Thread Val K
See web2py.js There is : $(ul).find(":text").after('+ -'). keypress(function(e) { return(e.which == 13) ? pe(ul, e) : true; }).next().click(function(e) { pe(ul, e); e.preventDefault(); }).next().click(function(e) { rl(ul, e);

[web2py] Re: fighting with the widget

2016-03-15 Thread Pierre
ok. l see the list:string class : class ListWidget(StringWidget) what i'd like to do is keep the default design and sqlform structure associated to list:string fields but to have my own javascript to manage a few things in particular the use of Jquery on() or Jquery delegate() to watch the

[web2py] Re: fighting with the widget

2016-03-15 Thread villas
Take a look around here . -- 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 receive