dojo

Dijit Tabcontainer inside a custom widget-Tablist width runs too long

你说的曾经没有我的故事 提交于 2019-12-10 17:38:53
问题 I have a templated custom widget that inherits from dijit.layout._LayoutWidget, dijit._Container, and dijit._Templated which gives my widget native Widget support for resizing, etc. All I need is a TabContainer, which is sized to the size of widget. Here is my widget. <div dojoAttachPoint="containerNode"> <div dojoType="dijit.layout.TabContainer" tabPosition="top" style="width:100%;height:100%" > <div dojoType="dijit.layout.ContentPane" title="tab" selected="true"> hello </div> </div> </div>

Dojo/on and the capture phase

☆樱花仙子☆ 提交于 2019-12-10 17:29:06
问题 Is there a way to trigger an event in the capture phase (instead of the bubbling phase) with dojo/on? 回答1: I ended up here looking for info on the predecessor of on() - dojo.connect(). For what it's worth, dojo.connect() does not appear to support event listeners for the capture phase. It works by adding the event handler to the DOM node as a field, e.g., node["mouseclick"] = ... Since you have to use addEventListener to receive events during the capture phase, my deduction is that dojo

Textbox autocomplete with DOJO

五迷三道 提交于 2019-12-10 17:21:56
问题 I am looking for a simple method using DOJO for a textbox autosuggest. The db table that I'll be querying against (using a PHP script, returned as JSON) has over 100,000 records, so this really shouldn't be in the form of a FilteringSelect or a ComboBox as I clearly don't want the user to return the entire data set by clicking on the down arrow. Other libraries like JQuery and YUI make it dirt simple, but this particularly project is DOJO based and I'm loath to introduce another JS class. 回答1

Can I change the Dojo namespace to something other than dojo?

你说的曾经没有我的故事 提交于 2019-12-10 16:59:30
问题 I know you can do it for jQuery using jQuery.noConflict. Is there a way to do something similar with Dojo? 回答1: I believe you can. See this page about running more than one version of Dojo on a page. It's fiddly, but seems to be what you're looking for. In general, both Dojo and jQuery have been quite careful not to clobber each other's or anyone else's variable names. 来源: https://stackoverflow.com/questions/247085/can-i-change-the-dojo-namespace-to-something-other-than-dojo

Dijit tree, how to improve performance for a large tree with 500 child nodes under root

China☆狼群 提交于 2019-12-10 16:13:21
问题 Each tree node contains other inner widgets, so it takes long time to render the whole 500 items especially in IE. It may take 10-20 seconds to render the tree in IE. I was wondering how to improve it, reduce the render time. Any suggestion on this? I found there is a TreeGrid, only show some rows at a time, and update the view while user scroll, does dijit.Tree have this capability? 回答1: If you don't have that many root nodes, you could use a lazy loading mechanism, see for example this

Dojo 1.7 Build: Out of Memory Errors

坚强是说给别人听的谎言 提交于 2019-12-10 15:54:34
问题 After upgrading to Dojo 1.7.3, our ant build that was working flawlessly for years on previous versions of Dojo is now completely non-operational due to out of memory errors: [java] starting writing resources... [java] java.lang.OutOfMemoryError: GC overhead limit exceeded [java] at org.mozilla.javascript.Interpreter.getArgsArray(Interpreter.java:4623) [java] at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335) [java] at org.mozilla.javascript.Interpreter.interpret

Dgrid set focus on cell

主宰稳场 提交于 2019-12-10 15:27:38
问题 I am using dgrid for displaying data in grid format , it has four columns. all are editable I have used following way to declare it. <table id="grid" data-dojo-type="dgrid.CustomGrid" data-dojo-props="store: memoryStore"> <thead> <tr> <th data-dgrid-column="dgrid.editor({ field: 'id' }, dijit.form.TextBox, 'click')">ID</th> <th data-dgrid-column="dgrid.editor({ field: 'name' }, dijit.form.TextBox, 'click')">Name</th> <th data-dgrid-column="dgrid.editor({ field: 'description' }, dijit.form

Can I pass parameter from a dynamic created dijit button onClick?

我们两清 提交于 2019-12-10 15:25:50
问题 I wonder, can I pass parameter from a dynamic created dijit button ? function testcallfromDynamicButton (value) { alert(value); } var thisButton = new dijit.form.Button({ label : thelineindex , id : "I_del_butt"+thelineindex, name : "I_del_butt"+thelineindex, onClick : testcallfromDynamicButton('test') }).placeAt( thetabletd1 ) ; Seems , this dosen't work, I tried to change to this. It works !! function testcallfromDynamicButton () { alert('test'); } var thisButton = new dijit.form.Button({

Calling object methods internally in dojo

六眼飞鱼酱① 提交于 2019-12-10 15:22:56
问题 I am trying to create a dojo class which contains functions which in turn call other functions within this class, as follows: dojo.provide("my.drawing"); dojo.declare("my.drawing", null, { constructor: function(/* Object */args){ dojo.safeMixin(this, args); this.container = args[0]; }, addPoint: function(event){ //calculate the x and y values by offsetting correctly var pos = dojo.coords(container); var x = event.clientX - pos.x; var y = event.clientY - pos.y; this.addAbsPoint(x,y); },

Firefox does not honor Content-type header in xhrPost

社会主义新天地 提交于 2019-12-10 15:20:33
问题 I am trying to post a json string to a REST service. The following code is being used: dojo.xhrPost( { url: REST_URL, postData: jsonData, handleAs: "json", headers: {"Content-Type": "application/json"}, load: function(response, ioArgs) { alert(response); }, error: function(response, ioArgs) { alert(response); } }); I intercept the requests sent by the browsers (IE/Firefox) using fiddler. When I submit the request from IE, fiddler shows the Content-type header being set to "application/json".