Architecture in the world of JMVC

0 views
Skip to first unread message

tqwhite

unread,
Feb 26, 2010, 5:05:45 PM2/26/10
to JavaScriptMVC
I have a demo app running and have used many features of
JavascriptMVC. I am able to operate the tool in a rudimentary way. Now
I am starting to figure out how to do things that I know I will want
to do in the future. First among these is global navigation but I am
very unsure how JMVC wants me to do it. It occurs to me that this
might be something that is interesting to others and I sure could use
some advice.

I want to have a set of controls of some sort that, when clicked, each
provide a different work context. Think, Page A supports Data Entry,
Page B supports Reporting and Analysis. Each wants to have completely
separate functions. I think that the basic organization is that I want
to have a document controller, call it the AppOvervallController and,
then I want to have PageAController, PageBController, etc.

Given this, I would have the global navigation receive a click (though
this is mysteriously failing right now) and tell the current page
controller to clean up and die, and then tell the newly clicked
controller to hop into action. Presumably, that controller would need
to have some number of application elements that do things.

For my demo, Page A has a category list that, when an item is clicked,
tells a detail list to fill itself with appropriate details. At
present, the category and the detail are each a separate controller.

Really, I'm looking for discussion about whether this is the right way
to think. But, I'm also wondering if those category and details are
supposed to be in their own controllers? Am I supposed to have a
controller for every operating <div> in the app? That also means that
I have a separate view folder for each, probably containing only one
file. That seems messy to me.

That's enough to ask but, I have one more thing to toss in. On the
JMVC website, I see that I can execute a statement like:

TodosController = Controller.extend("todos",{...));

Where "todos" refers to a DOM element named "todos" (id?). Is this how
I should be creating my category and detail controllers?

Thanks for any advice.

tqii

Justin Meyer

unread,
Feb 26, 2010, 5:17:46 PM2/26/10
to javasc...@googlegroups.com
I really appreciate all JMVC questions.  I am here to help.  But, I am insanely busy.  We give away JMVC for free, work on it on weekends, but I have one request ...

Please try to be as concise as possible when asking questions.  Ask a short simple question that other people can understand and benefit from.  

If anyone wants to ask long questions, we have paid support.  

I hope I'm not coming across like a dick.

Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
justin...@gmail.com



--
You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to javasc...@googlegroups.com.
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.


tqwhite

unread,
Feb 27, 2010, 12:06:06 AM2/27/10
to JavaScriptMVC
Thanks for the note. You don't seem at all like a dick to me. So far,
you seem like a really nice guy.

Honestly, I figured this was a question that should elicit some
general interest. I'm a big fan of that social networking thing. I
don't expect you to be responsible for my every question. I know that
I answer questions when I can, not here, yet, but elsewhere.
Hopefully, there are others that feel that way, too.

peace,
tqii

ps, I also want to thank you for this response. I am totally good with
"I see this but don't have time to focus on it. Good luck." Let's me
know what's going on.


On Feb 26, 4:17 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> I really appreciate all JMVC questions.  I am here to help.  But, I am
> insanely busy.  We give away JMVC for free, work on it on weekends, but I
> have one request ...
>
> Please try to be as concise as possible when asking questions.  Ask a short
> simple question that other people can understand and benefit from.
>
> If anyone wants to ask long questions, we have paid support.
>
> I hope I'm not coming across like a dick.
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
> 847-924-6039

> justinbme...@gmail.com

> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog legroups.com>

Justin Meyer

unread,
Feb 27, 2010, 10:52:19 AM2/27/10
to javasc...@googlegroups.com
So most people have this in their app as a PageController.

But instead of listening to clicks, it listens to history events.

Steps

1 add HREF to nav links that look like: href='#reports'.

2. Include the history plugin.

3. Add a main content div to your page.

4. Create a PageController that had the following:

"history.** subscribe": function(called, data) {
parse 'called' and extract controller name
$(#content).html('').controller().destroy()
$(#content)[controller_name+'_controller'](data)

}

Sent from my iPhone

> --
> You received this message because you are subscribed to the Google
> Groups "JavaScriptMVC" group.
> To post to this group, send email to javasc...@googlegroups.com.
> To unsubscribe from this group, send email to javascriptmv...@googlegroups.com

Reply all
Reply to author
Forward
0 new messages