Thanks for the quick reply, and yes that works! Still a bit puzzled why "sometimes" cljsc-vectors seem to be converted into arrays as in the (def abc ["jaja" "nee"]) example where I can see in the js-console that abc is an array js-object…
--- Yes, the js config dict and array objects are used "everywhere" and any additional support to make that easier to code in cljsc is appreciated. The proposed solutions sounds great. -FS. On Oct 15, 2011, at 5:47 PM, David Nolen wrote: > Vectors are not JavaScript arrays. No need to use the js/Array constructor: > > (array 1 2 3) > > Should work fine. Given how often JS frameworks want to be fed nested objects > like this, a patch for http://dev.clojure.org/jira/browse/CLJS-37 would be > nice. > > David > > On Sat, Oct 15, 2011 at 8:33 PM, Frank Siebenlist > <frank.siebenl...@gmail.com> wrote: > I'm trying to "translate" some js-code into cljsc, > and the following is a snippet that does it almost verbatim to see if I can > make things work: > > <code> > (def MyApp > (Ext.Application. > (make-js-map > {"name" "NotesApp" > "useLoadMask" true > "launch" (fn [] > (doall > (set! NotesApp.views.notesListToolbar > (Ext.Toolbar. (make-js-map > {"id" "notesListToolbar" > "title" "My Notes"}))) > > (set! NotesApp.views.notesListContainer > (Ext.Panel. (make-js-map > {"id" "notesListContainer" > "layout" "fit" > "html" "This is the notes list > container" > "dockedItems" (js/Array. > NotesApp.views.notesListToolbar) > ;; following doesn't work ??? > ;;"dockedItems" > [NotesApp.views.notesListToolbar] > }))) > > (set! NotesApp.views.viewport > (Ext.Panel. (make-js-map > {"fullscreen" true > "layout" "card" > "cardAnimation" "slide" > "items" (js/Array. > NotesApp.views.notesListContainer) > ;; following doesn't work ??? > ;;"items" > [NotesApp.views.notesListContainer] > }))) > > nil)) > }))) > </code> > > The issue I have is with the assignment of the cljsc-vector to a property in > the cljsc-map that is mapped to a js-config object… > When I use a native cljsc vector [] then it doesn't work, while using the > js/Array constructor it does. > > "doesn't work" means that something is wrong in the sencha touch internals as > it doesn't render, but doesn't give any errors. > > It is confusing as small examples like: > (def abc ["jaja" "nee"]) > do seem to translate without problems. > > Any insight or suggestions are greatly appreciated. > > Regards, FrankS. > > > > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en