Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery equivalents to ExtJS functions extend(), apply() and namespace()?

ExtJS provides some great helper functions like:

  • Ext.extend()
  • Ext.apply()
  • Ext.namespace()

Are there any equivalents in jQuery? I know I could port all three to jQuery since I like them so much, but maybe I'm missing something that's already there. I would like to avoid mingling with prototypes myself if possible.

Endresult

  • Ext.apply(obj1, obj2) => $.extend(obj1, obj2)
  • Ext.extend(obj1, obj2) => $.extend(obj1.prototype, obj2)
  • Ext.ns(string) => custom implementation
like image 453
Robert Koritnik Avatar asked Sep 10 '09 09:09

Robert Koritnik


1 Answers

jQuery's extend function is like ExtJS's apply function in that it copies data members from the source to the destination. The others might be already made as plugins, but I don't know of any.

like image 172
geowa4 Avatar answered Sep 18 '22 05:09

geowa4