classes: "xv-buttons",
components: [
{kind: "onyx.Button", name: "newButton", ontap: "newItem", classes: "icon-plus"},
- {kind: "font.TextIcon", name: "exportButton", ontap: "exportAttr", icon: "share", content: "_export".loc()} // TODO: classes?
+ {kind: "onyx.Button", name: "exportButton", ontap: "exportAttr",
+ icon: "share", content: "_export".loc(), classes: "icon-share"}
]
});
editor.render();
editor.setFirstFocus();
},
- exportAttr: function(inSender, inEvent) {
- var gridbox = inEvent.originator.parent.parent.parent;
+ exportAttr: function (inSender, inEvent) {
+ var gridbox = inEvent.originator.parent.parent;
this.doExportAttr({ recordType: gridbox.parent.parent.model,
uuid: gridbox.parent.parent.value.attributes.uuid,
attr: gridbox.attr });
// export just one attribute of the model displayed by the workspace
openExportTab: function (routeName, recordType, id, attr) {
- console.log('workspace exportAttr ' + recordType + '/' + attr + '(' + id + ')');
- var query = { parameters: [{ attribute: "uuid", value: id }]
- , details: { attr: attr }
+ var query = { parameters: [{ attribute: "uuid", value: id }],
+ details: { attr: attr }
};
// sending the locale information back over the wire saves a call to the db
window.open(XT.getOrganizationPath() +
var resultAsCsv,
filename = "export",
type,
- number = result.data && result.data.data && result.data.data[0]
- && (result.data.data[0].number || result.data.data[0].name),
- attr = requestDetails.query
- && requestDetails.query.details
- && requestDetails.query.details.attr
+ number = result.data && result.data.data && result.data.data[0] &&
+ (result.data.data[0].number || result.data.data[0].name),
+ attr = requestDetails.query &&
+ requestDetails.query.details &&
+ requestDetails.query.details.attr
;
try {
type = requestDetails.type;
- filename = type.replace("ListItem", "Export")
- + (attr && number ? "-" + number : "")
- + (attr ? "-" + attr : "")
+ filename = type.replace("ListItem", "Export") +
+ (attr && number ? "-" + number : "") +
+ (attr ? "-" + attr : "")
;
} catch (error) {