Opened 7 years ago

Closed 6 years ago

#16107 closed defect (patchwelcome)

dojox.DataGrid cannot use with "dojo/Deferred" (new version) in returning text deferred

Reported by: richso Owned by: Evan
Priority: undecided Milestone: tbd
Component: DojoX Grid Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description

dojox.DataGrid? cannot use with "dojo/Deferred" (new version) in returning text deferred, however "dojo/_base/Deferred" (old version) still works well in this situation; if this is the dojo team's intention, pls specify this clearly in the dojox.DataGrid? Tutorial and programming guide

Change History (6)

comment:1 Changed 7 years ago by nate

I'm not sure what is text deferred. Could you please provide code samples for the issue you mentioned? dojo/Deferred is new to 1.8 and is really different from the old one. BTW, dojox.DataGrid? has stopped being updated for new features since it will be replaced by GridX(http://oria.github.com/gridx) or dgrid(http://dgrid.io)

comment:2 Changed 7 years ago by richso

"returning text Deferred" means a formatter inside one of the dojo.DataGrid? field definition which return a dojo/_base/Deferred, in turn, which will return a string after resolved however dojo/Deferred do not, e.g.

require(["dojo/Deferred","dojo/when"], function(Deferred, when) {
            gridOrder = new dojox.DataGrid(); // simplified here
            var view1 = {
                cells: [
                    {name: 'Order No.', field: "order_num"},
                    {name: 'status', field: "status", formatter: function(data){
                        // *** see this code
                        var df = new Deferred();
                        when(orderStatusStore.get(data), function(obj){
                            df.resolve(obj['label']);
                        });

                        return df;
                    }},
                ]
            };
            var layout = [ view1 ];
            gridOrder.set('structure', layout);
});
  • the above grid will shows something like "[object Deferred]" instead of the text string for the status field.
  • I do not notice any information of GridX previously and also dgrid is in beta, therefore both will not be considered in our projects at the moment; change to use another Grid implementation may be a huge work.
Last edited 7 years ago by richso (previous) (diff)

comment:3 Changed 6 years ago by nate

Thanks for your information. This is an enhancement of DataGrid?. You may need to use the old Deferred in this scenario.

comment:4 in reply to:  3 Changed 6 years ago by richso

Replying to nate:

what I am asking is that you guys should add a "caution" note in the DataGrid? tutorial / Ref guide / migration guide of ver 1.8 for users who are using this DataGrid?. It seems that you are unlikely to enhance the DataGrid? for using the new "Deferred" as you have both dGrid and xGrid coming.

Thanks for your information. This is an enhancement of DataGrid?. You may need to use the old Deferred in this scenario.

comment:5 Changed 6 years ago by bill

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

We will consider patches to the old DojoX Grid code though.

comment:6 Changed 6 years ago by bill

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.