Opened 10 years ago

Closed 10 years ago

#9245 closed enhancement (fixed)

[1.3.1 Grid] Please keep allowing to pass widgetClass as a string

Reported by: vlad Owned by: Bryan Forbes
Priority: high Milestone: 1.4
Component: DojoX Grid Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

I am relying heavily on the functionality that allows to pass the Cell widgetClass as a string

But I see in 1.3.1 that this will be deprecated in 2.0. If it all possible please keep that functionality in.

Here is the reason: most of the widgets in my application are specified and stored in a database as JSON

That JSON gets generated from Dojo widget descriptions language, I have done in Lua

In Lua as well as many other languages such as PHP for example A multi-value arrays are typically specified as

key?="value" (in lua) or "key"=>"value" (in PHP)

specifying widgetClass=dijt.form.NumberSpiner?

would be invalid

So my simple code of converting the Hash Maps into json will fail -- that's what I rely on to generate Dojo widjet description JSON.

If I keep "dijit.form.NumberSpiner?" in quotes -- I get the dojo message that this functionality will be lost


(function(){

var dgc = dojox.grid.cells; dojo.declare("dojox.grid.cells._Widget", dgc._Base, {

widgetClass: dijit.form.TextBox?, constructor: function(inCell){

this.widget = null; if(typeof this.widgetClass == "string"){

dojo.deprecated("Passing a string to widgetClass is deprecated", "pass the widget class object instead", "2.0"); this.widgetClass = dojo.getObject(this.widgetClass);

}

},


In JSON it is illegal to specifying something like dojox

Change History (1)

comment:1 Changed 10 years ago by Nathan Toone

Milestone: tbd1.4
Resolution: fixed
Status: newclosed

At least in the latest in trunk, the code appears to exist for doing this (see dojox/grid/cells/dijit.js:26) - please reopen with a test case against the trunk if you are still having problems.

Note: See TracTickets for help on using tickets.