PDA

View Full Version : sencha command and deftjs to build project



javapurna
10 Jun 2013, 9:44 PM
hi every one ,

how to generate deftjs project using sencha command . i want to use deftjs in my project . i am generation extjs project using sencha cammand. but i am using detjs in my project so how to generate or adapt deftjs to sencha command used to generate project.

slemmon
12 Jun 2013, 11:29 AM
You're linking to the deftjs library js file from your index.html (or whatever the launch page is) currently, yes?

javapurna
12 Jun 2013, 8:49 PM
thanks for replying slemmon.
where to i am include deftjs library in sencha command generated project .
here i am providing sencha command Generated Project structure.
1)    i want to include deftjs library in that project . ( i am include that files in index.html later)
2) if i am build project with sencha command ,the library include in generated project44336

slemmon
14 Jun 2013, 1:20 PM
In your index page do you see something like this:



<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="../ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!-- </x-compile> -->


You should be able to link to another library (it will need to be local relative to the index page - can't link to another file system, url, etc) inside of the x-compile tags. Try linking to it right above the x-bootstrap tag up top and see if that compiles out in your all-classes.js file as expected.

javapurna
14 Jun 2013, 9:45 PM
thank you for replaying ,

it s gives error :[
[ERR] Failed to resolve dependency Deft.mvc.Application for file DeftjsApp.view. Application
[ERR] Error executing page compilation Unknown definition for dependency : Deft.
mvc.Application
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExNotFound: Unknown d
efinition for dependency : Deft.mvc.Application

].

my code is like this.

index.html

<!DOCTYPE HTML><html>
<head>
<meta charset="UTF-8">
<title>DeftjsApp</title>
<link rel="stylesheet" href="resources/default/app.css">
<!-- <x-compile> -->
<script type="text/javascript" src="deft.js"></script>
<!--<script type="text/javascript" src="deft/deft-debug.js"></script> -->// here deft is there in projectname -->app-->deft
<!--<script type="text/javascript" src="deft/deft.js"></script> -->
<script type="text/javascript" src="app/app-loader.js"></script>
<!-- <x-bootstrap> -->
<script src="../../../ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!-- </x-compile> -->
</head>
<body></body>
</html>


app.js


Ext.Loader.setConfig({
enabled:true,
disableCaching: false,
});
Ext.syncRequire(["DeftjsApp.view.Application"]);


Ext.create("DeftjsApp.view.Application");


Application.js

// Generated by CoffeeScript 1.4.0
/**
* DeftJS Application class for the Phoenix application.
*/


Ext.define("DeftjsApp.view.Application", {
extend: "Deft.mvc.Application",
requires: [ "DeftjsApp.view.Viewport","DeftjsApp.store.TreePanelStore"],

init: function() {
this.beforeInit();
Deft.Injector.configure({
testStore:'DeftjsApp.store.TreePanelStore',
});
Deft.promise.Deferred.enableLogging = false;
return this.afterInit();
},
beforeInit: function() {},

afterInit: function() {
Ext.tip.QuickTipManager.init();
return Ext.create("DeftjsApp.view.Viewport");
}
});

viewport.js
Ext.define('DeftjsApp.view.Viewport', { extend: 'Ext.container.Viewport',
requires:[
'Ext.tab.Panel',
'Ext.layout.container.Border',
'DeftjsApp.view.DashBoard'
],


layout: {
type: 'border'
},


items: [{
region: 'west',
xtype: 'panel',
title: 'west',
width: 150
},{
region: 'center',
xtype: 'tabpanel',
items:[{
title: 'Dashboard',
xtype:'dashboard'
}]
}]
});




app-loader.js
// Generated by CoffeeScript 1.4.0


Ext.Loader.setConfig({
enabled: true,
paths: {
"DeftjsApp": "app"
}
});


Ext.syncRequire(["Ext.Component", "Ext.ComponentManager", "Ext.ComponentQuery"]);


the problem is i am try to build project with sencha command . it gives above error.
and i am linking deftjs (deft.js and deft-debug.js in app->Deft(new folder), in project ->Deft(new folder)) i am trying in index.html. but no use.

please help me

slemmon
17 Jun 2013, 11:43 AM
What if you put app-loader.js just above your app.js link in your index page?