answerstu

Dojo grid not scrolling to last item

I'm teaching myself javascript by building a very basic web based chat application.Chat messages are posted to a web server. An HTML chat Client polls the web server periodically to download any new messages.The chat messages are displayed using a dojo grid.My problem is that I can't scroll the grid to the last message. I have tried using scrollToRow but it doesn't work.The javascript code is here =><html> <head> <style type="text/css"> @import "./dojoroot/dojo/resources/dojo.css"; @import "./dojoroot/dijit...Read more

xhtml - Where can I find the Dojo XMLNS DTD?

I want to add some Dojo widgets to my XHTML pages, but Dojo uses some attributes that aren't part of the XHTML spec. For example:<input dojoType="ComboBox" type="text" dataUrl="/some_data.json" />The dojoType and dataUrl attributes cause validation problems. I believe Dojo lets me move dojoType into the class attribute:<input class="dojo-ComboBox" type="text" dataUrl="/some_data.json" />That solves part, but not all of the problem. The "correct" solution would look something like this:<input dojo:type="ComboBox" type="text" do...Read more

styles - width of splitter using dojo containers

I am using dojo containers with the splitter. As far as I can tell, the splitter is either true or false. My customers are having a hard time grabbing the splitter. I'd like to make it a little wider. But I don't see any way to control the width.<div id="sidepanel" data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props="splitter: true, region:'leading'"style=" width: 285px"> <div data-dojo-type="dijit/layout/AccordionPane" title="pane #1">accordion pane #1</div> <div data-dojo-type="dijit/layout/Accordion...Read more

dojo splitter not resizing properly with dynamic content

I'm creating a seemingly simple dojo 1.8 web page which contains an app layout div containing a tab container and an alarm panel below the tab container. They are separated by a splitter so the user can select how much of the alarms or the tabcontainer they want to see.Here's the example on jsfiddle:http://jsfiddle.net/bfW7u/For the purpose of the demo, there's a timer which grows the table in the alarm panel by an entry every 2 seconds. The problem(s):If one doesn't do anything and just lets the table grow, no scroll bar appears in the alarm p...Read more

dojo - dijit.Tree not collapsing when reloaded

I have implemented a dijit tree with checkboxes as per the implementation provided on http://jsfiddle.net/5QcFY/14/ and that is working perfectly fine. I am displaying the tree on dialogue box. There are "categories" as parent nodes and "types" as the children nodes. Initially all the parents nodes are displayed collapsed. Once user selects options from children nodes from tree and closes the dialogue box, the selected items are getting passed to the further processing logic.Below is my implementation:typeTreeHandle = new dijit.Tree({ ...Read more

javascript - How do I find count of class within a DIV

I have the following HTML writen in dojo:<div id="102_do_3_9_id_z_3" class="element_unit_index nominal out">2</div>This is one example of what I can generate, but I have 20 types of elements similar to this one. I wonder how I can get number of defined classes on one DIV, so that I get array of classes and in the array I can check if this element is not equal with 'nominal' then dojo.removeClass(tmp_elm_on_div_ins_id,this._state);...Read more

dojo - How to break out of a sequence of asynchronous operations in a loop?

Following this exampleDojo FAQ: How can I sequence asynchronous operations?function doNext(previousValue) { var dfd = new Deferred(); // perform some async logic; resolve the promise setTimeout(function () { var next = String.fromCharCode(previousValue.charCodeAt(previousValue.length - 1) + 1); dfd.resolve(previousValue + next); }, 50); return dfd.promise;}var promise = doNext('a');for (var i = 0; i < 9; i++) { promise = promise.then(doNext);}promise.then(function (finalResult) { // 'doNext' will have been ...Read more

Dojo Slider isReversed

What I am trying to do is detect, using onChange, if a dojo horizontal slider is being dragged right to left. This happens to be in IBM XPages, but the area of CSJS code below should be universal. How do I use the _isReversed property to get true/false?<xe:djHorizontalSliderstyle="margin-left:5px;width:200px;height:20px"id="djHorizontalSlider1" showButtons="false" defaultValue="1" maximum="15" minimum="1"intermediateChanges="true" discreteValues="8" value="#{viewScope.sliderNumber1}"><xe:this.converter><xp:convertNumber integerOn...Read more

dependencies - Using dojo.require() without dojo.declare()

I'm quite confused from Dojo's documentation. How can I use dojo.require() without actually using dojo.declare()? The reason I don't want to use dojo.declare() is that it exposes declared class as global variable.Right now my code looks like this:HTML file:dojo.require('module.test');Module/test.js:dojo.provide('module.test');function test() { return 'found me';}I just can't get Dojo to return test() method anywhere. What's the correct pattern for using dojo.require() without declaring?...Read more

bar chart - Series label in barchart in dojo

I am using Dojo 1.8. Please help me to know how to add series label in barchart in runtime. Following is the example of static values but what if I have values:"one,two,three,four" in an array. How I will use array in runtime to assign series labels.chart.addAxis("x",{ labels: [ {value: 1, text: "one"}, {value: 2, text: "two"}, {value: 3, text: "three"}, {value: 4, text: "four"}]});RegardsGaurav...Read more

javascript framework - Dojo : show() and hide() .... HOW?

I have a container element in which I create on the fly/place() a form, then another one..etc.My goal is to switch between them i.e. hide all and show only the active form.It hides alright, but I can't show the active back.I tried using:.style.display(none<->block) and visibility(visibility<->hidden) dojo.style(...)resize() and startup() after the changesSeveral other variants i found on Internet from old dojo's Nothing works./I need it to work with display, so that it does not occupy space./Can you tell me what is the correct way to show...Read more

Episerver/CMS & Dojo/Aspect– how to catch revert to publish event in Dojo?

In post Event on "Revert to Published" I found code to "attach" to revertToPublished event.dojo.require(["dojo/aspect", "epi/dependency"], function(aspect, dependencey) { var editingCommands = dependency.resolve("epi.cms.contentEditing.command.Editing"); aspect.before(editingCommands.revertToPublished, "_execute", function() { // TODO: Reverting Content To Published });});Basically the code is proper and should work but at least in my widget if I set up this in postCreate: function () {}does not so the advise method is never cal...Read more