Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function onSaveButtonClick2():void
- {
- var result:String = "";
- for each (var column:ReportColumn in selectedReport.columns)
- {
- result += printColumn(column) + ",";
- }
- printTextArea.text = result;
- }
- private function printColumn(column:ReportColumn):String
- {
- var data:Object = column.getData();
- var result:String = "{" + '\n';
- result += '"id": ';
- result += '"' + data.id + '",' + '\n';
- result += '"db": ';
- result += '"' + data.db + '",' + '\n';
- result += '"result": ';
- result += '"' + data.result + '",' + '\n';
- result += '"type": ';
- result += '"' + data.type + '",' + '\n';
- result += '"class": ';
- result += '"' + data["class"] + '"';
- if (column.parent)
- {
- result += ",\n"
- result += '"relationName": ';
- result += '"' + column.parent["name"] + '"';
- }
- if (data.hasOwnProperty("DATA"))
- {
- result += ",\n"
- result += '"DATA": ';
- result += JSON.stringify(data["DATA"]);
- }
- result += "\n}";
- return result;
- }
- <s:TextArea id="printTextArea" width="100%" height="100%"/>
- <mx:Button id="printBtn"
- width="100"
- label="{_('Print me babe')}"
- enabled="{buttonsEnabled}"
- click="onSaveButtonClick2()" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement