首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

3查的View & Controller binding

2013-03-16 
三查的View & Controller binding带着ROR的思想看三查,几乎被看到了沟里,几个弯始终拐不过来。比如,sancha

三查的View & Controller binding

带着ROR的思想看三查,几乎被看到了沟里,几个弯始终拐不过来。比如,sancha似乎并不像ROR那样默认通过名字来绑定V和C,具体是怎么做的,我纠结了好久。今天写程序的时候终于开了窍,总结规则如下:

?

? ? // The name of controller and view does not necessary to have any relationship,?

? ? // Essentially the controller does not bind to any "view", rather than bind to

? ? // certain UI element defined in refs, by using componentSelector

? ? //

? ? // So the MVC behavor of sencha is not exactly same as in ROR, which the name

? ? // of controller and view has kind of mapping by default

? ? //

? ? // And the most important thing here, is that:

? ? // WE ACTUALLY COULD BIND A DOM EVENT OF SINGLE VIEW TO MULTIPLE CONTROLLERS,

? ? // BY DEFINE THE SAME SELECTOR!

? ? // VICE VERSA, A SINGLE CONTROLLER COULD DEFINE SET OF HANDLERS FOR DOM EVENT

? ? // SITS IN MULTIPLE VIEWS!

热点排行