Zazakallah khair for sowing interest to my issue.
I am new to the marionette as well as marionette/backbone so my issue may be very stupid. Please pardon me.
define(
[
"require",
"jq",
"jqui",
"jqs",
"jlb",
"jl",
"mt",
"tpl!app/template/bdrLayouttpl.tpl"
],
function(
require,
jq,
jqui,
jqs,
jlb,
jl,
mt
){
var Mn = require('mt');
var tpl = require("tpl!app/template/bdrLayouttpl.tpl");
console.log(tpl);
var aview = Mn.View.extend
(
{
template:tpl,
regions:{
content : '.west',
footer : '.south',
util : '.center'
},
onAttach:function(
options
){console.log("in onAttach");
jQuery(
function($) {
var container = $('#layout');
function layout() {
container.layout({
resize: false,
type: 'border',
vgap: 1,
hgap: 1
});
};
$(window).resize(layout);
layout();
layout();
}
);
},
onRender:function(
options
){
this.showChildView('content', new contentView());
this.showChildView('footer', new footerView());
this.showChildView('util', new utilView());
}
}
);
return new aview();
}
);
define(function (
require
){
var tk=require("tk");
var bac = tk.Component.extend({
ViewClass: function(options){
if(options.border){
return require("app/view/bapbdrView");
}
else if(options.doc){
return require("app/view/bapdocView");
}
else
return require("mt").View;
}
});
function createBlogComponent(options){
return new bac(options);
};
return createBlogComponent;
},
function(
err
){
//The errback, error callback
//The error has a list of modules that failed
var failedId = err.requireModules && err.requireModules[0];
console.log("In err "+failedId);
console.log(err);
}
);
App is as follows
define(function (
require
){
var tk=require("tk");
var bb=require("bb");
var ba = tk.App.extend({
onStart: function(
options
){
var apcomp = require("app/component/bapcomp")(options);
apcomp.showIn(this.getRegion());
if(bb.history){
bb.history.start();
if(ba.getCurrentRoute() === ""){
this.trigger(
// "contacts:list"
);
}
}
},
onBeforeStart: function(
options
){
this.model = this.options.data;
},
onBeforeStop: function(
options
){
},
onStop: function(
options
){
}
});
ba.navigate = function(route, options){
options || (options = {});
bb.history.navigate(route, options);
};
ba.getCurrentRoute = function(){
return Backbone.history.fragment;
};
return new ba();
},
function(
err
){
//The errback, error callback
//The error has a list of modules that failed
var failedId = err.requireModules && err.requireModules[0];
console.log("In err "+failedId);
console.log(err);
}
);
requirejs.config({
baseUrl: "assets/js/",
paths: {
"jquery" : "lib/jquery/jquery",
"jqui" : "lib/jquery/jquery-ui-1.10.4",
"jlayout" : "lib/jquery/jquery.jlayout",
"jlayout.border" : "lib/jquery/jlayout.border",
"jquery.sizes" : "lib/jquery/jquery.sizes",
"backbone" : "lib/marionette/backbone",
"json2" : "lib/json2/json2",
"backbone.radio" : "lib/marionette/backbone.radio",
"backbone.marionette" : "lib/marionette/backbone.marionette",
"marionette.toolkit" : "lib/marionette/marionette.toolkit",
"underscore" : "lib/underscore/underscore",
"tpl" : "lib/require/underscore-tpl",
"text" : "lib/require/text"
},
waitSeconds: 20,
map: {
"*": {
jq :"jquery",
bb :"backbone",
bbr :"backbone.radio",
mt :"backbone.marionette",
jl :"jlayout" ,
jlb :"jlayout.border",
jqs :"jquery.sizes",
js2 :"json2",
tk :"marionette.toolkit",
us :"underscore"
}
},
config: {
underscoreTemplateSettings: {
interpolate: /\{\{\s*([^#\{]+?)\s*\}\}/g, // {{ title }}
evaluate: /\{\{#([\s\S]+?)\}\}/g, // {{# console.log("stuff") }}
escape: /\{\{\{([\s\S]+?)\}\}\}/g // {{{ title }}}
},
shim: {
"jqui":{
deps: ['jq']
},
"jl":{
deps: ['jq']
},
"jqs":{
deps: ['jq']
},
"jlb":{
deps: ['jq']
},
"tpl":{
deps: ['us','text']
},
"us": {
exports: "_"
},
"bb": {
exports: ["Backbone"],
deps: ['jq','us','js2']
},
"bbr":{
exports: ["Radio"],
deps: ["bb"]
},
"mt": {
exports: "Marionette",
deps: ["bb","bbr"]
},
"tk": {
exports: "Toolkit",
deps: ["mt"]
}
},
deps: ['app/main']
});
But chrome js console is blank.Would you like to help me please to fix the problem?I will remain grateful to you.