Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#13420 closed defect (fixed)

MVC - allow data property to be predefined on the prototype of StatefulModel

Reported by: ben hockey Owned by: rahul
Priority: high Milestone: 1.7
Component: DojoX MVC Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

StatefulModel? assumes an object is passed to the constructor with a data property. i'm using composejs (https://github.com/kriszyp/compose) to compose a temporary constructor with all the data mixed in to the prototype and then calling the constructor with no params. this works fine with all of dijit but StatefulModel? won't allow this pattern.

this small change would fix it.

  • StatefulModel.js

     
    349349                        //              the data structure.
    350350                        // tags:
    351351                        //              private
    352                         if(args.data){
    353                                 this._createModel(args.data);
     352                        var data = (args && args.data) || this.data;
     353                        if(data){
     354                                this._createModel(data);
    354355                        }
    355356                },
    356357

Change History (4)

comment:1 Changed 11 years ago by rahul

Looks OK to me.

comment:2 Changed 11 years ago by ben hockey

thanks. i'll commit - let me know if problems arise later.

comment:3 Changed 11 years ago by ben hockey

Resolution: fixed
Status: newclosed

(In [25762]) allow data to be predefined on StatefulModel? prototype. fixes #13420 !strict

comment:4 Changed 11 years ago by bill

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.