dojo

Cross domain loading of widget template

本小妞迷上赌 提交于 2019-12-25 03:32:22
问题 I am hosting a widget on another domain than the site in which I am embedding the widget. The dashboard.js loads fine, but the HTML template gets, XMLHttpRequest cannot load http://192.168.2.72:8081/widgets/templates/dashboard.html. Origin http://192.168.2.72:8080 is not allowed by Access-Control-Allow-Origin. The url to the template is correct, so I can only assume this is a cross domain error. In the widget, the template is referred to like: templatePath: dojo.moduleUrl("monitor/dashboard",

Cross domain loading of widget template

陌路散爱 提交于 2019-12-25 03:32:01
问题 I am hosting a widget on another domain than the site in which I am embedding the widget. The dashboard.js loads fine, but the HTML template gets, XMLHttpRequest cannot load http://192.168.2.72:8081/widgets/templates/dashboard.html. Origin http://192.168.2.72:8080 is not allowed by Access-Control-Allow-Origin. The url to the template is correct, so I can only assume this is a cross domain error. In the widget, the template is referred to like: templatePath: dojo.moduleUrl("monitor/dashboard",

Dojo CheckedMultiSelect text wrap and horizontal scrolling

为君一笑 提交于 2019-12-25 03:27:05
问题 How to make DOJO CheckedMultiSelect text wrapped and how to enable horizontal scrolling in the same control, if the select text is larger that the control size 回答1: All you need is to overwrite CSS rules. See working example at jsFiddle: http://jsfiddle.net/phusick/qrSWu/ For both of your needs you need to limit the width of dojox/form/CheckedMultiSelect . It can be done adding narrow class to the markup <select data-dojo-type="dojox/form/CheckedMultiSelect" class="narrow"> or JavaScript (via

dojo datagrid custom sorting server side

这一生的挚爱 提交于 2019-12-25 03:24:14
问题 I am using dojo.data.ItemFileWriteStore to draw a dojo datagrid (which works fine) and the grid shows properly. I was using client side sorting and that was also working fine. but now I need to change the sorting and do that server side. For this I am trying to use onHeaderCellClick event, using which I am able to run a javascript function.. something like gridInfo = { store: myJsonStore, structure: myStructure onHeaderCellClick:getSortedTable }; Now here is the getSortedTable function which

dojo.requireIf does not allow local variables

泄露秘密 提交于 2019-12-25 03:22:14
问题 I've been trying to use dojo.require(If) with a local variable to dynamically load a module on a page based on a condition. // note: dojo v1.4 djConfig = { debugAtAllCosts: true }; Example 1 (does not work) : (function() { var nameOfClass = "Two"; dojo.require("my.namespace." + nameOfClass); dojo.addOnLoad(function() { var oneOrTwo = new my.namespace[nameOfClass](); }); }()); Error: ReferenceError: nameOfClass is not defined. Example 2 (does not work) : (function() { var nameOfClass = "Two";

DataGrid's rowsPerPage attribute not working

旧城冷巷雨未停 提交于 2019-12-25 02:19:04
问题 I need to add pagination feature to few of my DataGrids and I am just moving ahead step by step. To begin with I tried setting 'rowsPerPage' attribute of DataGrid to some value, say 5. But it has no impact on the displayed grid. I mean number of rows displayed are more than the value set to 'rowsPerPage'. <table dojoType="dojox.grid.DataGrid" store="tags" rowsPerPage =3 style="width: 100%; height: 500px;"> <thead> <tr> <th width="150px" field="dept">Namey</th> <th width="150px" field="name"

IBM Worklight - Unable to navigate between views

前提是你 提交于 2019-12-25 02:13:35
问题 I am trying to develop a simple app that consist of multiple scrollable views, but the navigation between views like from "Home" view to "view1" is not working. Unable find out the reason of that... HTML: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>index</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="shortcut icon" href="images/favicon.png">

dojo treeGrid aggregate not working after refreshing jsonStore

懵懂的女人 提交于 2019-12-25 02:13:09
问题 I have dojo treeGrid that shows totals for child items. Everything works fine. But if I replace/update store and refresh then aggregation doesn't work and all totals shown as NaN. What am I doing wrong? var layout = [ { cells: [ [ {field: "userName", name: "Name"}, {field: "childItems", children: [ { field: "debit", name: "debit"}, { field: "credit", name: "credit"} ], aggregate: "sum" } ]] } ] var jsonStore = new dojo.data.ItemFileWriteStore({ url: "<............>"}); var grid = new dojox

Dojo: How to load an object (containing other objects) from JSON?

对着背影说爱祢 提交于 2019-12-25 02:06:37
问题 I have an object model that I want to be able to save. I am going to export it to JSON and then read it back in as JSON. Saving to JSON is easy. Just use this: JSON.stringify(this) . Loading from JSON isn't as simple. We can't just use this = JSON.parse(someJson) because the methods wont be attached. Using something like lang.mixin(this, JSON.parse(someJson)) will get the functions but objects that are Photo Class: define([...], function(...){ return declare(null, { name: ..., // String url:.

Dojo AMD loader not working in Domino 9.0

戏子无情 提交于 2019-12-25 01:01:57
问题 When I put this on my Form (not XPage): <script src="/xsp/.ibmxspres/dojoroot/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script> calls like this: require(["dojox/validate/web"], function(validate) { validate.isEmailAddress(someAddress); }); fail with error (this error is from Opera 12.15): Unhandled Error: Undefined variable: require I checked with Chrome network panel that dojo.js is loaded and tried also with IE10. If I use: <script src="//ajax.googleapis.com/ajax/libs