Adv. javascript support -- function keyword
Posted: Wed Aug 22, 2007 6:34 pm
I'd like to be able to take advantage of some of the more advanced features of Javascript in Servoy. I don't know if this is planned for 4.0, but it would be very powerful if we could extend objects with Prototypes -- or at least declare and assign functions in our code.
For example, I have several generic bit of functionality I want to extend certain forms with -- such as remembering last size/position for dialog forms. If I could extend the form onLoad, I could write a global method like:
Right now, the Servoy method editor blocks the use of the "function" keyword (even in a literal string!).
It would open up a lot of options to overcome this limitation. Thanks,
greg.
For example, I have several generic bit of functionality I want to extend certain forms with -- such as remembering last size/position for dialog forms. If I could extend the form onLoad, I could write a global method like:
- Code: Select all
var frm = argument[0];
frm.get_last_size = function{ return [frm.size_w,frm.size_h]; };
frm.get_last_position = function{ return [frm.position_x,frm.position_y]; };
Right now, the Servoy method editor blocks the use of the "function" keyword (even in a literal string!).
It would open up a lot of options to overcome this limitation. Thanks,
greg.