dojo

Implementing a hyperlink within a dojo datagrid

亡梦爱人 提交于 2019-12-23 09:20:06
问题 This is my first time working with datagrids so please forgive anything that is unclear. I have json text that is being implemented in a dojo datagrid (dojox.grid.DataGrid). var jsonStore = new dojo.data.ItemFileWriteStore({ url: "xAgent.xsp"}); var layout = [ {cells:[ [ {field:'firstname', name:'First'}, {field:'lastname', name:'Last'}, {field:'policy', name:'Policy'}, {field:'lastaccessed', name:'Last Accessed'} ] ], noscroll:false } ]; grid = new dojox.grid.DataGrid({ store: jsonStore,

How to mock a Node.js module loaded with dojo/node

我的未来我决定 提交于 2019-12-23 06:05:24
问题 I have an application with the server code running on Node.js and using Dojo. I have a config module defined like: define([ 'dojo/node!nconf', 'dojo/_base/config' ], function (nconf, dojoConfig) { nconf.argv().file({ file: dojoConfig.baseDir + '/config.json' }); console.log('-- file name:', dojoConfig.baseDir + '/config.json'); console.log('-- context:', nconf.get('context')); // ... logic here ... return nconf.get(nconf.get('context')); }); To be able to unit test this module, I've written

Dojo Issue: .parent() not a function

半世苍凉 提交于 2019-12-23 02:47:08
问题 The HTML snippet: <div class="hide_on_start"> <label>Type of Visit</label> <div id="record_visit_type"></div> </div> <div class="hide_on_start"> <label>Visit Date</label> <div id="record_visit_date"></div> </div> <div class="hide_on_start"> <label>Staff</label> <div id="record_staff"></div> </div> The javascript I am using: >>> dojo.byId('record_visit_type') <div id="record_visit_type"> >>> dojo.byId('record_visit_type').parent().removeClass('hide_on_start') TypeError: dojo.byId("record_visit

Dojo Issue: .parent() not a function

孤街浪徒 提交于 2019-12-23 02:47:05
问题 The HTML snippet: <div class="hide_on_start"> <label>Type of Visit</label> <div id="record_visit_type"></div> </div> <div class="hide_on_start"> <label>Visit Date</label> <div id="record_visit_date"></div> </div> <div class="hide_on_start"> <label>Staff</label> <div id="record_staff"></div> </div> The javascript I am using: >>> dojo.byId('record_visit_type') <div id="record_visit_type"> >>> dojo.byId('record_visit_type').parent().removeClass('hide_on_start') TypeError: dojo.byId("record_visit

dijit.byId(“”).is not defined in Worklight works with Angularjs

只谈情不闲聊 提交于 2019-12-23 02:07:30
问题 I make a project in worklight used dojo mobile 1.8.1 and angularjs 1.0.1,but i got a strange problem. Here is my html part: <div data-dojo-type="dojox.mobile.ScrollableView" data-dojo-props="selected:true" id="id1" ></div> <div class="full" data-dojo-type="dojox.mobile.View" id="id2"></div> and my JavaScript part: require([ "dojo", "dijit/_base/manager","dojo/parser", "dijit/registry", ], function(dojo) { dojo.ready(function() { // dijit.byId("id1").performTransition("id2"); //////////place I

TDD的JavaScript单元测试工具

一个人想着一个人 提交于 2019-12-22 20:39:45
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我研究并考虑了许多JavaScript单元测试和测试工具,但一直无法找到合适的选项来保持与TDD的完全兼容。 那么,是否有一个完全符合TDD的JavaScript单元测试工具? #1楼 看一下 Dojo对象线束(DOH)单元测试框架 ,它是JavaScript单元测试的几乎与框架无关的工具,并且没有任何Dojo依赖项。 使用Dojo Objective Harness对Web 2.0应用程序进行单元测试时 ,对此有很好的描述。 如果要自动化UI测试(许多开发人员的 苦恼 ),请查看 doh.robot (临时向下更新:其他链接 http://dojotoolkit.org/reference-guide/util/dohrobot.html ) 和 dijit .robotx (暂时关闭) 。 后者专为验收测试而设计。 更新: 引用的文章介绍了如何使用它们,如何模拟用户使用鼠标和/或键盘与UI交互以及如何记录测试会话,以便以后可以自动“播放”它。 #2楼 作为专家,您可以“在实际的浏览器上运行”,但是根据我的经验,这是一个缺点,因为它运行缓慢。 但是,使之具有价值的是非浏览器替代品缺乏足够的JS仿真。 如果您的JS非常复杂,以至于仅在浏览器中进行测试就足够了,但是还可以考虑以下两个选项: HtmlUnit :

dojo.parser.parse only working first time it's called

大城市里の小女人 提交于 2019-12-22 18:28:18
问题 I have a page that when a user clicks on a link for some reporting tools, it first asks them to enter some report parameters. I get the parameters dialog as a form using AJAX, based on the id of the link. Each dialog has some dojo controls on it, so I need to parse them when the dialog appears, because it is not originally part of the page. The first dialog when called works fine, but subsequent calls to dialogs fails to parse the dojo controls. Example: showParametersDialog : function(doc) {

How to determine if a dojo grid has finished loading?

◇◆丶佛笑我妖孽 提交于 2019-12-22 17:51:26
问题 I'm working with Selenium to drive a site that uses Dojo. Since the site's Dojo grid uses lazy loading, it's difficult for my test framework to know if/when the grid has finished loading. However, Selenium does let you inject Javascript. Is there a way to either poll the DOM, or use js directly, to find out if a grid has finished loading? 回答1: Here is a great answer that I found: grid.connect(grid, '_onFetchComplete', function(){ for(var i in grid._pending_requests){ if(grid._pending_requests

Getting global handler to all AJAX calls in dojo

拥有回忆 提交于 2019-12-22 17:20:46
问题 I need to invoke some common methods before an AJAX call is made and after the AJAX call (before the actual handler method is called) is success. I'm using dojo.aspect to achieve this. This is my code sample function makeAjaxCall(){ dojo.xhrGet({ url:"sample_url", content:{ test:"value" }, load:function(response){ //Do some logic here }, error:function(response){ //handle error } }); } Below is the dojo.aspect which I'm using to get a hook to the XHR calls. define(["dojo/aspect"], function