Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Does inheritsFrom require a .ds.xml for both DS?

    I have defined shared/ds/myDS.ds.xml on the server, and it includes a binary field. On the client, I want the option of obtaining that field using encodeInResponse:true, so it would seem that I can define a new DataSource on the client to do this for me. Here's what should work based on what I see in the documentation:

    Code:
    isc.defineClass("myNewDS",myDS);
    var newDS = isc.myNewDS.create({
       inheritsFrom: myDS,
       fields:[
          {name:"structure",type:"binary",encodeInResponse:true}
       ]
    });
    but when I try to use newDS, I get the error:
    Code:
    Can't find dataSource: isc_myNewDS_0 - please make sure that you have a isc_myNewDS_0.ds.xml file for it in [webRoot]/shared/ds
    Is there a way to do DS inheritance w/o making another .ds.xml file?

    #2
    Yes the file is required, not because of inheritance per se but because encodeInResponse is a setting that is intended for server code. When you create a DataSource on the client-side, the server doesn't know about it, and has no way of reading that setting.

    Comment

    Working...
    X