google chart with extjs3.3.1 not give output - google-chrome

<html>
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.3.1/resources/css/ext-all.css"/>
<script type="text/javascript" src="http://extjs.cachefly.net/ext-3.3.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http://extjs.cachefly.net/ext-3.3.1/ext-all-debug.js"></script>
<script type="text/javascript" src="http://dev.sencha.com/playpen/google-visualization/GVisualizationPanel.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
Ext.onReady(function() {
var lineChartDs = new Ext.data.SimpleStore({
fields: [
{name: 'yr', type: 'string'}
,{name: 'sales', type: 'int'}
,{name: 'expenses', type: 'int'}
],
data: [['2004',1000,400],['2005',1170,460],['2006',860,580],['2007',1030,540]]
});
var lineChart1 = new Ext.ux.GVisualizationPanel({
id: 'lineChart',
visualizationPkg: 'linechart',
title: 'Company Performance Sample',
store: lineChartDs,
columns: [
{dataIndex: 'yr', label: 'Year'}
,{dataIndex: 'sales', label: 'Sales'}
,{dataIndex: 'expenses', label: 'Expenses'}
]
})
new Ext.Viewport({
layout: 'fit',
items: [lineChart1]
});
});
</script>

there are problem with GVisualizationPanel.js file do the change in line no 23
tbl.addColumn(convert[f.type.type], c.label || c, id);
after that its working with extjs 3.3.1

Related

typeAhead autocomplete is not working

I am new to typeahead. I am getting the json data from remote and is shown in the network. The problem is The returned data is not autocompleted in the text box. Below is my code
Style and Script Used
<link href="{{ asset('css/bootstrap-tagsinput.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('css/bootstrap-tagsinput-typeahead.css') }}" rel="stylesheet" type="text/css" />
<script src="{{ asset('js/bootstrap-tagsinput.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/handlebars.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/typeahead.bundle.min.js') }}" type="text/javascript"></script>
Textbox
<input type="text" name="language" placeholder="Language" id="typeahead_lang" class="tagsinput-typeahead"/>
Script
<script>
$(document).ready(function () {
var cities = new Bloodhound({
datumTokenizer : Bloodhound.tokenizers.obj.whitespace('text'),
queryTokenizer : Bloodhound.tokenizers.whitespace,
remote: {
url: '{{ route("admin.packagelanguage") }}',
}
});
cities.initialize();
var elt = $('#typeahead_lang');
elt.tagsinput({
itemValue: 'value',
itemText: 'text',
typeaheadjs: {
name: 'cities',
displayKey: 'text',
source: cities.ttAdapter()
}
});
});
</script>
Json Returned data
[{text: 'English', value:'1' },{text: 'Afar', value:'2' },{text: 'Abkhazian', value:'3' },{text: 'Afrikaans', value:'4' },{text: 'Amharic', value:'5' }]
I am using laravel framework. How to autocomplete the returned the data in that text box. Please Help me.
A little late but,this code works for me.
var elt = $('#elt');
elt.tagsinput({
itemValue: 'value',
itemText: 'text',
typeaheadjs: [{
hint: true,
highlight: true,
minLength: 2
},{
name: 'cities',
displayKey: 'text',
source: cities.ttAdapter()
}
]
});

Getting ng-option text inside html

My Code:
HTML:
<select ng-model="selectedItem" ng-options="item.result as item.name for item in items"></select>
JS:
$scope.items = [{'name': 'Yes', 'result': true },{ 'name': 'No', 'result': false }];
I want to display Yes and No in the select box whereas I have to send true and false to the server when Yes or No is selected respectively.
I have another div where I have to display the option text (ie Yes or No (selected one) ). I used {{selectedItem.label}} but it is not working. Please help.
Used Sajeetharan's answer and updated it to meet your requirement.
Following is the code:
<!DOCTYPE html>
<html ng-app="todoApp">
<head>
<title>To Do List</title>
<link href="skeleton.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="MainViewController.js"></script>
</head>
<body ng-controller="dobController">
<select class="form-control" id="selection" ng-model="currentSelected" ng-options="selection.result as selection.name for selection in items"></select>
<div>
<h1> Selected one is : {{currentSelected? "Yes": (currentSelected == null)? "":"No"}} </h1>
</div>
<script>
var app = angular.module('todoApp', []);
app.controller("dobController", ["$scope",
function($scope) {
$scope.items = [{'name': 'Yes', 'result': true },{ 'name': 'No', 'result': false }];
}
]);
</script>
</body>
</html>
Demo
var app = angular.module('todoApp', []);
app.controller("dobController", ["$scope",
function($scope) {
$scope.items = [{'name': 'Yes', 'result': true },{ 'name': 'No', 'result': false }];
}
]);
<!DOCTYPE html>
<html ng-app="todoApp">
<head>
<title>To Do List</title>
<link href="skeleton.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="MainViewController.js"></script>
</head>
<body ng-controller="dobController">
<select class="form-control" id="selection" ng-model="currentSelected" ng-options="selection.result as selection.name for selection in items"></select>
<div>
<h1> Selected one is : {{currentSelected}} </h1>
</div>
</body>
</html>
Use directive to get the desired result of displaying the selected item name value but send the result value to backend.
var app = angular.module('app', []);
app.controller("myctrl", ["$scope",
function($scope) {
$scope.items = [{
'name': 'Yes',
'result': true
}, {
'name': 'No',
'result': false
}];
}
]);
app.filter('getvalue', function() {
return function(value, array) {
if (value !== undefined && value !== null) {
var selectedOption = array.filter(function(l) {
if (l.result == value) {
return l;
}
})[0];
return selectedOption["name"];
} else {
return "";
}
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="app" ng-controller="myctrl">
<select class="form-control" id="selection" ng-model="currentSelected" ng-options="selection.result as selection.name for selection in items"></select>
<div>
Displayed Text : {{currentSelected | getvalue:items}}
</div>
<div>
Value which will be send : {{currentSelected}}
</div>
</body>

how to specify my Longitude and latitude for use in a timemap

I'm having trouble figuring out how to specify my Longitude and latitude for use in a timemap. This is my JSON:
[{"lon":"106.78185","title":"ZAKI","start":"2016-05-25","description":"OPERATION","Id":1,"lat":-6.2206087,"timeStart":"18:00:00"}]
And below is the HTML file I'm working with.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>TESTER</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=MyKey&sensor=false"></script> <script type="text/javascript" src="lib/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="lib/mxn/mxn.js?(googlev3)"></script> <script type="text/javascript" src="lib/timeline-2.3.0.js"></script> <script type="text/javascript" src="lib/timeline-1.2.js"></script> <script type="text/javascript" src="src/timemap.js"></script> <script type="text/javascript" src="timemap_full.pack.js"></script> <script type="text/javascript" src="src/loaders/json.js"></script> <script type="text/javascript" src="src/loaders/progressive.js" ></script>
<script type="text/javascript">
var tm;
var errFn = function(jqXHR, textStatus, errorThrown){
alert(textStatus);
}
$(function() {
TimeMap.loaders.custom = function(options) {
var loader = new TimeMap.loaders.remote(options);
loader.parse = JSON.parse;
loader.preload = function(data) {
return data["rows"]
}
loader.transform = function(data) {
return {
"title" : data.title,
"start" : data.date,
"options" : {
"description" : data.description
},
"point": {
"lat" : data.Lat,
"lon" : data.Lon
}
};
};
return loader;
};
// <!--start loading data-->
tm = TimeMap.init({
mapId: "map", // Id of map div element (required)
timelineId:"timeline", // Id of timeline div element (required)
options: {
eventIconPath: "/TimeMaps/images/"
},
datasets: [
{
title: "Tacking OPS",
type: "json",
options: {
// json file
method:'GET',
url: "getDataTracking",
error: errFn
}
}
],
bandIntervals: [
// Timeline.DateTime.DAY,
// Timeline.DateTime.WEEK
Timeline.DateTime.DAY,
Timeline.DateTime.MONTH
]
});
});
</script>
<link href="css/examples.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div id="help">
<h1>TIME MAPS CSA</h1>
</div>
<div id="timemap">
<div id="timelinecontainer">
<div id="timeline"></div>
</div>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>TESTER</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=MyKey&sensor=false"></script>
<script type="text/javascript" src="lib/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="lib/mxn/mxn.js?(googlev3)"></script> <script type="text/javascript" src="lib/timeline-2.3.0.js"></script> <script type="text/javascript" src="lib/timeline-1.2.js"></script>
<script type="text/javascript" src="src/timemap.js"></script>
<script type="text/javascript" src="timemap_full.pack.js"></script> <script type="text/javascript" src="src/loaders/json.js"></script>
<script type="text/javascript" src="src/loaders/progressive.js" ></script>
<script type="text/javascript">
var tm;
var errFn = function(jqXHR, textStatus, errorThrown){
alert(textStatus);
}
$(function() {
TimeMap.loaders.custom = function(options) {
var loader = new TimeMap.loaders.remote(options);
loader.parse = JSON.parse;
loader.preload = function(data) {
return data["rows"]
}
loader.transform = function(data) {
return {
"title" : data.title,
"start" : data.date,
"options" : {
"description" : data.description
},
"point": {
"lat" : data.Lat,
"lon" : data.Lon
}
};
};
return loader;
};
// <!--start loading data-->
tm = TimeMap.init({
mapId: "map", // Id of map div element (required)
timelineId:"timeline", // Id of timeline div element (required)
options: {
eventIconPath: "/TimeMaps/images/"
},
datasets: [
{
title: "Tacking OPS",
type: "json",
options: {
// json file
method:'GET',
url: "getDataTracking",
error: errFn
}
}
],
bandIntervals: [
// Timeline.DateTime.DAY,
// Timeline.DateTime.WEEK
Timeline.DateTime.DAY,
Timeline.DateTime.MONTH
]
});
});
</script>
<link href="css/examples.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div id="help">
<h1>TIME MAPS CSA</h1>
</div>
<div id="timemap">
<div id="timelinecontainer">
<div id="timeline"></div>
</div>
<div id="mapcontainer">
<div id="map"></div>
</div>
</div>
</body> </html>
<div id="mapcontainer">
<div id="map"></div>
</div>
</div>
</body> </html>
this my servlet code
for (int i = 0; i < listDataTracking.size(); i++) {
org.json.simple.JSONObject obj = new org.json.simple.JSONObject();
EntityTracking dataTracking = listDataTracking.get(i);
if (dataTracking.getIdTracking() == null) {
obj.put("Id", "");
} else {
obj.put("Id", dataTracking.getIdTracking());
// writer.print(dataTracking.getIdTracking());
}
if (dataTracking.getTglSend() == null) {
obj.put("start", "");//tanggal
} else {
obj.put("start", sdf.format(dataTracking.getTglSend()));
// writer.print(sdf.format(dataTracking.getTglSend()));
}
if (dataTracking.getJamSend() == null) {
obj.put("jamstart", "");
} else {
obj.put("jamstart", dataTracking.getJamSend());
// writer.print(dataTracking.getJamSend());
}
if (dataTracking.getUser_name().getUserName() == null) {
obj.put("title", "");
} else {
obj.put("title", dataTracking.getUser_name().getUserName().toUpperCase());
// writer.print(dataTracking.getUser_name().getUserName());
}
if (dataTracking.getUser_name().getRoleName() == null) {
obj.put("description", "");
} else {
obj.put("description", dataTracking.getUser_name().getRoleName().toUpperCase());
// writer.print(dataTracking.getUser_name().getUserName());
}
if (dataTracking.getGetLatitude() == null) {
obj.put("lat", "");
} else {
//
obj.put("lat", dataTracking.getGetLatitude());
}
if (dataTracking.getGetLongitude() == null) {
obj.put("lon", "");
} else {
//
obj.put("lon", dataTracking.getGetLongitude());
}
arrayObj.add(obj);
}
My new HTML file
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<!-- <meta http-equiv="content-type" content="text/html; charset=utf-8"/>-->
<title>~:. TimeMaps .:~</title>
<link rel="shortcut icon" href="images/csalogo.ico" type="image/x-icon"/>
<!--
<script async defer src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
-->
<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
<!-- <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyBTquZF3N7wt_qze9l02cX8MSAkUEvBpuE&sensor=false"></script>-->
<!-- <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>-->
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
-->
<script type="text/javascript" src="lib/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="lib/mxn/mxn.js?(googlev3)"></script>
<script type="text/javascript" src="lib/timeline-1.2.js"></script>
<script src="src/timemap.js" type="text/javascript"></script>
<script src="src/timemap.js" type="text/javascript"></script>
<script src="src/loaders/json.js" type="text/javascript"></script>
<script src="src/loaders/progressive.js" type="text/javascript"></script>
<!-- <script src="src/ext/circle_icons.js" type="text/javascript"></script>-->
<!-- source
http://www.vermontelectric.coop/custom/timemap/docs/symbols/TimeMap.loaders.json.html
http://www.ibiblio.org/tamil/maps/docs/symbols/TimeMap.loaders.jsonp.html#constructor
http://stackoverflow.com/questions/26683375/loading-json-into-timemap
https://groups.google.com/forum/#!topic/timemap-development/MNjFbvMY42w
http://www.gps-coordinates.net/
http://en.marnoto.com/2014/04/converter-coordenadas-gps.html
https://developers.google.com/maps/documentation/javascript/examples/#basics
http://geekswithblogs.net/bosuch/archive/2011/10/05/converting-decimal-degrees-to-degreesminutesseconds-astronomy-with-your-personal-computer.aspx
http://stackoverflow.com/questions/2342371/jquery-loop-on-json-data-using-each
http://jsfiddle.net/5pjha/
-->
<script type="text/javascript">
var tm;
var isi_url ="getDataTrackingServlet";
var isi_jon, lon,lat,title,start,jamstart,description,theme;
var errFn = function(jqXHR, textStatus, errorThrown){
alert(textStatus);
}
// $(function() {
$(function() {
$.getJSON(isi_url, function (json) {
$.each(json.results, function(i, item) {
lat = item.lat;
lon = item.lon;
title = item.title;
start = item.start;
description = item.description;
jamstart = item.jamstart;
theme = item.theme;
// })
console.log('Latitude : ',i, lat);
console.log('Longitude : ',i, lon);
console.log('title : ',i, title);
console.log('start : ',i, start);
console.log('description : ',i, description);
console.log('jamstart : ',i, jamstart);
console.log('theme : ',i, theme);
tm = TimeMap.init({
mapId: "map", // Id of map div element (required)
timelineId:"timeline", // Id of timeline div element (required)
options: {
mapType: "physical",
eventIconPath: "/TimeMaps/images/"
},
datasets: [
{
// id:"trackingOPs",
title: "Tacking OPS",
//type:"basic","json"
type: "basic",
options: {
// method:'GET',
// url: isi_url,
// "theme": "Red",
// error: errFn,
items: [
{
"start" : item.start,
"end" : item.jamstart,
"point" : {
"lat" : item.lat,
"lon" : item.lon
},
"title" : item.title,
"options" : {
// set the full HTML for the info window
"infoHtml": "<div class='custominfostyle'><b>"+item.title+"<br/>"+"Divisi :"+" "+item.description+"<br/>"+"Postition :"+item.lat+","+item.lon+
"</b></div>",
"theme": item.theme
}
}],events: {
click: function(marker, event, context){
markerSelected(context.id);
}
// items: [
// {
// "start" :"2016-05-27",
// "end" : "2016-05-27",
// "point" : {
// "lat" : -6.2206089,
// "lon" : 106.7810652
// },
// "title" : "ZAKI",
// "options" : {
// // set the full HTML for the info window
// "infoHtml": "<div class='custominfostyle'><b>Domenico Ghirlandaio</b> was a visual artist of some sort.</div>"
// }
// }]
}
}
}
],
// bandIntervals: [
// // Timeline.DateTime.DAY,
// // Timeline.DateTime.WEEK
// Timeline.DateTime.DAY,
// Timeline.DateTime.MONTH
// ]
// bandInfo: [
// {
// width: "85%",
// intervalUnit: Timeline.DateTime.DAY,
// intervalPixels: 210
// },
// {
// width: "15%",
// intervalUnit: Timeline.DateTime.MONTH,
// intervalPixels: 150,
// showEventText: false,
// trackHeight: 0.2,
// trackGap: 0.2
// }
// ]
bandIntervals: "wk"
});
// filter function for tags
var hasSelectedTag = function(item) {
console.log(item.opts.tags.indexOf(window.selectedTag));
// if no tag was selected, everything passes
return !window.selectedTag || (
// item has tags?
item.opts.tags &&
// tag found? (note - will work in IE; Timemap extends the Array prototype if necessary)
item.opts.tags.indexOf(window.selectedTag) >= 0
);
};
// add our new function to the map and timeline filters
tm.addFilter("map", hasSelectedTag); // hide map markers on fail
tm.addFilter("timeline", hasSelectedTag); // hide timeline events on fail
// onChange handler for pulldown menu
$('#tag_select').change(function() {
window.selectedTag = $(this).val();
// run filters
tm.filter('map');
tm.filter('timeline');
});
});
});
});
//<!--end loading data-->
</script>
<link href="css/examples.css" type="text/css" rel="stylesheet"/>
<style>
div#timelinecontainer{ height: 310px; }
div#mapcontainer{ height: 300px; }
</style>
</head>
<body>
<div id="help">
</div>
<div id="timemap">
<div id="timelinecontainer">
<div id="timeline"></div>
</div>
<div id="mapcontainer">
<div id="map"></div>
</div>
</div>
</body>
</html>
new My json Data
{
"results":[
{
"lon":"106.7810652",
"title":"ZAKI",
"start":"2016-06-01",
"description":"OPERASIONAL",
"theme":"red",
"Id":1,
"lat":"-6.2206089",
"jamstart":"18:00:00"
},
{
"lon":"106.7822585",
"title":"ARDYAN",
"start":"2016-06-01",
"description":"OPERASIONAL",
"theme":"orange",
"Id":2,
"lat":"-6.2216851",
"jamstart":"18:00:00"
}
]
}
new output Image
console.log
TimeMaps
Does anyone have suggestions? Thanks,

Using ng-grid in partial page

Is there any example of using ng-grid in partial pages. Whenever I try to use, an error pops up as TypeError: Cannot set property 'myData' of undefined.
My App.js
'use strict';
// Declare app level module which depends on filters, and services
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'myApp.controllers', 'ngGrid']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'MyCtrl1'});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: 'MyCtrl2'});
$routeProvider.otherwise({redirectTo: '/view1'});
}]);
Controller.js
'use strict';
/* Controllers */
angular.module('myApp.controllers', ['ngGrid']).
controller('MyCtrl1', [function ($scope) {
$scope.myData = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{ name: "Enos", age: 34 },];
$scope.gridOptions = {
data: 'myData',
columnDefs: [{ field: 'name', displayName: 'Name' },
{ field: 'age', displayName: 'Age', cellTemplate: '<div ng-class="{green: row.getProperty(col.field) > 30}"><div class="ngCellText">{{row.getProperty(col.field)}}</div></div>' }],
showGroupPanel: true
};
}])
.controller('MyCtrl2', [function() {
}]);
//MyCtrl1.$inject = ['$scope'];
Partial1.html
<p>This is the partial for view 1.</p>
<div class="gridStyle" ng-grid="gridOptions"></div>
<div style="clear:both"/>
<p>{{ myData | json }}</p>
Partial2.html
<p>This is the partial for view 2.</p>
<p>
Showing of 'interpolate' filter:
{{ 'Current version is v%VERSION%.' | interpolate }}
</p>
And index.html
<!doctype html>
<html xmlns:ng="http://angularjs.org" id="ng-app" lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>My AngularJS App</title>
<link rel="stylesheet" href="css/app.css"/>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/ng-grid.css">
<link rel="stylesheet" href="css/Style.css">
<!-- In production use:
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
-->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="js/ng-grid-2.0.5.min.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/filters.js"></script>
<script src="js/directives.js"></script>
<script src="js/controllers.js"></script>
</head>
<body>
<ul class="menu">
<li>view1</li>
<li>view2</li>
</ul>
<div ng-view></div>
<div>Angular seed app: v<span app-version></span></div>
</body>
</html>
Can you please say, why 'myData' is unavailable in Partial1.html?
Thanks in advance.
It is probably too late, but for the code right here
{name: "Enos", age: 34 },];
you don't need the coma. It should read:
{name: "Enos", age: 34 }];

dojo 1.7.2+ require custom module

I have written a custom modyle, for example it is printing "Hello World" to the console.
require([
"dojo/_base/declare"
],
function(declare) {
return [
declare("Hello", null, {
printHello : function() {
console.log("Hello, World!");
}
})
];
}
);
And the name of the .js file is "Hello.js". In my html page I need this module, but I have a problem with loading it. My code:
<script type="text/javascript">
var dojoConfig = {
async : true,
parseOnLoad : false,
isDebug : true,
packages: [
{ name: "gui", location: "/scripts/gui" }
]
};
require([
"gui/common/Hello"
],
function(HelloFunciton) {
var hello = new Hello();
hello.printHello();
});
</script>
But I have a error in console:
"NetworkError: 404 Not Found - http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/scripts/gui/common/Hello.js"
It should the javascript file from the localhost...
What might be the problem?
Add baseUrl: "./" to your dojoConfig.
Also make the path to your package relative via ./scripts/gui.
Complete HTML file:
<html>
<head>
<script>
var dojoConfig = {
async: true,
baseUrl: "./",
parseOnLoad: false,
isDebug: true,
packages: [
{ name: "gui", location: "./scripts/gui" }
]
}
</script>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"></script>
<script>
require(["gui/common/Hello"], function(Hello) {
var hello = new Hello();
hello.printHello();
});
</script>
</head>
<body>
</body>
</html>
The module file ./scripts/gui/common/Hello.js:
define([
"dojo/_base/declare"
], function(
declare
) {
return declare([], {
printHello: function() {
console.log("Hello world!");
}
});
});