Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#14666 closed enhancement (fixed)

Allow extension of dojox/app/view with templateString defined

Reported by: nickmaynard Owned by: Eric Wang
Priority: undecided Milestone: 1.8
Component: DojoX App Version: 1.7.0
Keywords: Cc:
Blocked By: Blocking:

Description

Fairly simple, this just needs conditional, rather than default, mixing-in of templateString when instantiating the child view in scene.js. This allows a dojox/app/view with custom templateString.

Patch, paths will require trimming to apply it:

### Jazz Patch 1.0 #date: "2012-01-24 00:15:32.000000034 +0000" #itemid: "BankDataDojoWeb/WebContent?/dojo/dojox/app" "_ynz4QEXPEeG0YuuH60K5Wg" "_ptq_4EM_EeGZHp7HYk4s2g" #item_type: "_ynz4QEXPEeG0YuuH60K5Wg" "folder" #itemid: "BankDataDojoWeb/WebContent?/dojo/dojox/app/scene.js.uncompressed.js" "_yoB6sEXPEeG0YuuH60K5Wg" "_ptq_4EM_EeGZHp7HYk4s2g" #item_type: "_yoB6sEXPEeG0YuuH60K5Wg" "file" #before_state: "BankDataDojoWeb/WebContent?/dojo/dojox/app/scene.js.uncompressed.js" "_yoB6sEXPEeG0YuuH60K5Wg" "_9IPlqUXZEeG-5NjYUuFGQw" # diff -u -N BankDataDojoWeb/WebContent?/dojo/dojox/app/scene.js.uncompressed.js BankDataDojoWeb/WebContent?/dojo/dojox/app/scene.js.uncompressed.js --- BankDataDojoWeb/WebContent?/dojo/dojox/app/scene.js.uncompressed.js 2012-01-05 09:31:00.000000550 +0000 +++ BankDataDojoWeb/WebContent?/dojo/dojox/app/scene.js.uncompressed.js 1970-01-01 01:00:00.000000256 +0100 @@ -144,12 +144,15 @@

throw Error("Unable to find appropriate ctor for the base child class");

}

  • var params = dojo.mixin({}, conf, {

+ var mixinParams = {

id: self.id + "_" + childId,

  • templateString: conf.template?arguments[0][arguments[0].length-1]:"<div></div>",

parent: self, app: self.app

  • })

+ }; + Conditionally add a templateString parameter - dojox/app/view has a default anyway so we don't need to enforce one + if (conf.template) mixinParams.templateString = arguments[0][arguments[0].length-1]; + + var params = dojo.mixin({}, conf, mixinParams);

if (subIds){

params.defaultView=subIds;

}

Attachments (1)

patch.txt (1.6 KB) - added by nickmaynard 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by nickmaynard

Attachment: patch.txt added

comment:1 Changed 7 years ago by nickmaynard

Ideally this would work for other levels such as dojox.app.schema. This may already be the case - I haven't tested that level.. yet.

comment:2 Changed 7 years ago by Eric Wang

in dojox.app 1.8, you can use new dojox.app.view to create view with template string

this.view = new View({
	id: this.id,
	name: this.name,
	parent: this,
	templateString: this.templateString,
	definition: this.definition
});

comment:3 Changed 7 years ago by cjolif

Resolution: fixed
Status: newclosed

comment:4 Changed 7 years ago by bill

Milestone: tbd1.8

comment:5 Changed 7 years ago by nickmaynard

--redacted--

Last edited 7 years ago by nickmaynard (previous) (diff)
Note: See TracTickets for help on using tickets.