kind: "XV.Groupbox",
classes: "panel xv-grid-box",
events: {
- onChildWorkspace: ""
+ onChildWorkspace: "",
+ onExportAttr: ""
},
handlers: {
ontap: "buttonTapped",
]}
);
- // "New" button
components.push({
kind: "FittableColumns",
name: "navigationButtonPanel",
classes: "xv-buttons",
components: [
- {kind: "onyx.Button", name: "newButton", onclick: "newItem", classes: "icon-plus"}
+ {kind: "onyx.Button", name: "newButton", onclick: "newItem", classes: "icon-plus"},
+ {kind: "font.TextIcon", name: "exportButton", onclick: "exportAttr", icon: "share", content: "_export".loc()} // TODO: classes?
]
});
editor.render();
editor.setFirstFocus();
},
+ exportAttr: function(inSender, inEvent) {
+ var gridbox = inEvent.originator.parent.parent.parent;
+ this.doExportAttr({ recordType: gridbox.parent.parent.model,
+ uuid: gridbox.parent.parent.value.attributes.uuid,
+ attr: gridbox.attr });
+ },
refreshLists: function () {
this.$.aboveGridList.refresh();
this.$.belowGridList.refresh();
onReport: "report",
onStatusChange: "statusChanged",
onTitleChange: "titleChanged",
- onSaveTextChange: "saveTextChanged"
+ onSaveTextChange: "saveTextChanged",
+ onExportAttr: "exportAttr"
},
components: [
{kind: "FittableRows", name: "navigationPanel", classes: "xv-menu-container", components: [
saveTextChanged: function (inSender, inEvent) {
this.$.saveButton.setContent(inEvent.content);
},
+
+ exportAttr: function (inSender, inEvent) {
+ this.openExportTab('export', inEvent.recordType, inEvent.uuid, inEvent.attr);
+ return true;
+ },
+
+ // export the data for just one attr 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 }] };
+ // TODO: limit the data treated to just attribute: attr
+
+ // sending the locale information back over the wire saves a call to the db
+ window.open(XT.getOrganizationPath() +
+ '/%@?details={"nameSpace":"%@","type":"%@","query":%@,"culture":%@,"print":%@}'
+ .f(routeName,
+ recordType.prefix(),
+ recordType.suffix(),
+ JSON.stringify(query),
+ JSON.stringify(XT.locale.culture),
+ "false"),
+ '_newtab');
+ },
/**
This is called for each row in the menu List.
The menu text is derived from the corresponding panel index.