Login Register

Custom Widget

Custom widget accessing nested html

Hello Everyone,

I am trying to create a templated widget and fortunately my in my html file I have HTML that is statically defined within a widget element.
what I mean is, in my html I have

<div id="leftColumn" dojoType="test.filter">
   <div id="someId">Hello World</div>
  </div>

I know that when Dojo creates a widget, it removes the DOM element used to define it.
So what I need is a way to get all the nested HTML DOM elements in either the constructor or the preamble function, before Dojo removes them.

Custom widget disappears inside a BorderContainer

 I have a custom, non-templated widget that renders just fine when not enclosed in a container, or when enclosed within a ContentPane. However, if I nest the widget inside a BorderContainer it is not rendered. What am I doing wrong?

Here is the widget:

dojo.provide("ws.Simple");
dojo.declare("ws.Simple",  [dijit._Widget],
    {
      postCreate: function () {
        this.domNode.innerHTML = "Simple Widget";
      }
    });

It lives in file /js/ws/Simple.js. Dojo lives at /js/dojo.

loading custom modules in ie7 (2)

Loaded this initially against earlier topic but forgot the code tags and seems to have mucked up page so sorry about that. Anyway I was trying to say that I have a similar issue but does not seem to be related to commas. Have simplified to the extreme but still no joy. Have been testing up until now in firefox and works fine, but no joy in ie7.

My simplied cutom class is seen below stored in file struture dojoroot/my/form/ButtonCtrl.js where dojo.js is in dojoroot/dojo:

dojo.provide("my.form.ButtonCtrl");
dojo.require("dijit.form.Button");

How do I do rounded corners with the latest version of Dojo (1.1.1)?

Hello, what code do I need for the require statements for rounded corners for the latest version of Dojo (1.1.1)? I have seen examples for previous versions of Dojo, but most Dojo examples are pretty far out of date from what I have seen.

How to reference nodes in a widget declaratively

Hi guys,

I have a widget with an html template similar to this:

<div dojoAttachPoint='div1'></div>
<div dojoType='myCustomWidget' dojoAttachPoint='widget1'></div>

I need to reference div1 from widget1 declaratively. I know that programmatically i can do this in my widget:
this.widget1.setTargetDiv(this.div1);

dojox.dtl.demo_blog.html working as expected?

My goal is to change a widget's template upon user interaction (e.g. user selects from a combobox in widget => widget's combobox template is replaced with a button template) using setTemplate in dojox.dtl._HtmlTemplate.

I tried copying from dojox.dtl.demo_blog.html, but it appears that it does not behave as I would expect it to. Can anyone comment on its behavior?

Im using the latest 1.1.1 dev

Thanks! BTW... I just took an awesome dojo class from Neil Roberts, he was very helpful and started me down this crazy path of creating dtl templated widgets. ;-)

Lost in inheritance, help would be appriciated (dojo 0.9 -> 1.0)

hi

I would appriciate some help of the more experienced users on this forum.

I have a collection object, and an gallery widget In dojo 0.9 I would call my gallery widget and pass the collection object as parameter in the new () statement.

In the constructor() I could then access via this.method the methods from the collection object, however in 1.0 it doesn't do that anymore.

[SOLVED] Tooltips do not work in programmatically created Custom Widget

I was able to correct this by creating a DOM node for the Custom Widget

// Need a domNode in the document to add the Search Form to
	var tmpDiv = dojo.body().appendChild(document.createElement('div'));
	
	// Create Search Form Widget
	var hl7SearchForm = new emory.eventsearch.HL7SearchCriteria({
		id: "hl7SearchForm_" + tabId,
		layoutAlign: "client"},tmpDiv);

My original Post:

I have a custom widget that contains tooltips that don't work when I create the widget programmatically.
I am using Dojo version: 1.0.

Using compiled custom build still shows separate HTTP GET calls

I am trying to compile Dojo with custom widgets and run it locally (no XDomain). The Dojo compile runs without a hitch, but when including the compiled JS file in our HTML, Firebug says that we are still requesting each of the classes separately using an HTTP GET inside dojo.js! Weird, huh?

Here is our directory structure:


/js/dojo/dojo <-- src version of Dojo
/dijit
/dojox
/custom <-- custom widgets extending Dijit
/release/dojo/dojo <-- release version of Dojo
/dijit
/dojox

Dijit Template file not loading

I am migrating my custom dijit from 0.9.0 to 1.0.2. I notice that although the templatePath is correct (& the file exists), the file is not loaded. When using 0.9.0, FireBug explicitly listed it, but now the file is not listed in FireBug.

dojo.declare("my.company.Popup", [dijit._Widget, dijit._Templated, dijit._Container], {
  templatePath: dojo.moduleUrl("my", "company/templates/Popup.html",
  templateString: ""
});

Can anybody point me to what I might be missing?

Syndicate content