Add Custom Data Type/Field in Jaydata

143 views Asked by At

How can I add a custom data type in Jaydata wherein I can just add anything on it and have it output in http://localh.ost/blahblah/$metadata ? Like

$data.Entity.extend("Office", {
    Id: { type: "id", key: true, computed: true },
    OfficeName: { type: "string", maxLength:50, alternativeName:"office_name" }
});

Like I want to add the alternativeName and have it output in the browser so that when I type the http://localh.ost/blahblah/$metadata, I can see it as one of the fields. Like:

//other XML output here
<Property MaxLength="50" Name="OffName" Type="Edm.String" alternativeName="office_name"/>
//other XML output here

Right now, I can only see this:

<Property MaxLength="50" Name="OffName" Type="Edm.String" />

So how can I achieve this?

1

There are 1 answers

0
Gabor Dolla On

Start the custom attribute name with $ sign