Login Register

container

Collapse BorderContainer Pane

Is there a good way to collapse a region/pane in the BorderConntainer? I'd like to make the east/west regions resizable and collapsable. So that when the user drags the bar it resizes the pane. But when they click it, it auto resizes to 0 (with the slide effect). Thanks for any help.

dynamic dnd containers

Problem: I need to be able to create containers on the page that can hold dnd nodes after the page has already been created. For example, a user clicks a button and it creates a new container next to the containers that have already been created. Is this possible? I understand how to create containers I'm just stuck on this.

Repeated container add/delete eventually crashed dojo

My goal is to have the shopping cart consolidate multiple instances of the same item into one item with a count.

I do this by checking, in the cart's creator function, for an item in the cart with the same data.id as the dndItem we are about to create:
* The cart is scanned for a dndItem with the same data.id as the data.id passed to the creator.
** If such a dndItem is found:
*** I.data.count is copied.
*** is deleted.
*** The creator returns data with data.count = I.data.count + 1.
** If no dndItem with a matching data.id is found:

dndItem value changes out from under me.

When a second copy of an item is dropped onto my cart, I bump the count on the previous item and delete the new item. The code that computes the cost of the cart then sees one item with a count of 2.

When another copy is dropped, the count on the item already in the cart is back to 1.

Any idea why?

The function in question is longer than the forum allows. The full description is at http://kevinkoch.com/dojo.dnd-question.txt.

How to access data in items in a dnd container?

My dojo.dnd.Source cart has items in it. Each item has data associated with it. We know this because the creator can access data.name, data.price, etc.

When a new item is dropped onto cart, I want to update a "Your total is" display, by adding up data.price of all the items in the cart.

But cart.getAllNodes() returns an array of HTMLDivElement and the data isn't accessible.

How do I access the data in each item in a dojo.dnd.Source?

When is the best time to call addChild on layout containers?

I can't find this answer in the Book of Dojo. I'm nesting layout containers inside layout containers. When should I call addChild() to add it to the parent container?

Should I add them as I create them?....

var bc1 = new dijit.layout.BorderContainer(...);
var bc2 = new dijit.layout.BorderContainer(...);
bc1.addChild(bc2);
var bc3 = new dijit.layout.BorderContainer(...);
bc2.addChild(bc3);

...or should I create all of them first, and then add them together at the end?

var bc1 = new dijit.layout.BorderContainer(...);

Create BorderContainer programmatically

Hi,
I try create BorderContainer programmatically with this way:

document.body.appendChild(node); // necessary for tab contianer ???
node.style.cssText = "border: 2px solid black; width: 90%; height: 300px; padding: 10px;";
var bc = new dijit.layout.BorderContainer({design: "sidebar"},node);

var node = document.createElement("div");
document.body.appendChild(node);
node.style.cssText = "background-color: #b39b86; height: 100px;";
var widget = new dijit.layout.ContentPane({region: "top", splitter: "true"},node);
bc.addChild(widget);

Syndicate content