开发者

javascriptMVC jqueryMX Controller VS. widgets - can we all get along?

We built a ajax website and are thinking of migrating to javascriptMVC. Our site has our own home-made controller which handles ajax calls for html and JS and the UI uses JQuery UI widgets extensively.

I read a bit about javascriptMVC and liked the notion of how models are being handled. especially how easy it is to interact with ajax to read you data. I gues开发者_Go百科s i always though of models as JSON objects (structs in a way) and forgot how powerful adding methods to the models could prove to be.

However, going deeper into the javascriptMVC i noticed the controller takes much of the JQuery UI widgets responsibilities. i hate to drop our already working widgets. What are our options?

Can we adopt just the model of the JQueryMX? is it wise? Should we change our controller and widgets completely and do an all-in into JavascriptMVC? Any other options?

Speaking of goals - we wish to have a framework for future Ajax sites (controller + widgets).


You can wrap JQuery UI widgets inside of JMVC controllers as an intermediate step but you are losing an important advantage controllers have over typical JQuery plugins. Most JQuery plugins are written in an all-or-nothing style (look at jqGrid as an example) - mixing multiple JQuery plugins is typically impossible or at least quite hard and leads to an ugly codebase that does not perform well (memory leak issues etc.).

JMVC controllers can be designed to be more lightweight so they work well in combination with other controllers. Look at mxui for the "right" way to build widgets in JQueryUI

https://github.com/jupiterjs/mxui

http://forum.javascriptmvc.com/topic/what-are-the-plans-for-mxui

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜